Jump to content

no module named numpy in python 3

PorterG2003
import numpy as np

 

error:

Traceback (most recent call last):
  File "2layerNeuralNetwork.py", line 5, in <module>
    import numpy as np
ModuleNotFoundError: No module named 'numpy'

 

troubleshooting:

I have installed numpy using pip

I have uninstalled numpy then reinstalled it

Link to comment
Share on other sites

Link to post
Share on other sites

pip install bumpy.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

On 6/30/2018 at 3:24 PM, gabrielcarvfer said:

Did you create a virtual environment (venv)? If you did, you need to activate the virtual environment through the terminal and then run pip.

No I'm running this on my normal enviroment

Link to comment
Share on other sites

Link to post
Share on other sites

On 6/30/2018 at 3:22 PM, vorticalbox said:

pip install bumpy.

that didn't work

Capture.PNG

Link to comment
Share on other sites

Link to post
Share on other sites

You might have installed it for Python 2. Try "pip3 install numpy".

My boring Github   /人◕ ‿‿ ◕人\

Link to comment
Share on other sites

Link to post
Share on other sites

4 hours ago, jincio said:

he misspell it its: "pip install numpy"

Phone auto corrected it, thanks for clearing up.

                     ¸„»°'´¸„»°'´ Vorticalbox `'°«„¸`'°«„¸
`'°«„¸¸„»°'´¸„»°'´`'°«„¸Scientia Potentia est  ¸„»°'´`'°«„¸`'°«„¸¸„»°'´

Link to comment
Share on other sites

Link to post
Share on other sites

14 hours ago, Erik Sieghart said:

Yeah it's pip3 unless you're in virtual or changed some settings somewhere.

That did not work

Capture.PNG

Link to comment
Share on other sites

Link to post
Share on other sites

You may have multiple versions of python installed and pip is installing to a different version than "py" is using.

 

In the command prompt run:

where py

If you can also provide the output of:

path

then we can see if the location that pip is installing numpy (in your appdata) is in your path.

Link to comment
Share on other sites

Link to post
Share on other sites

On 7/5/2018 at 7:21 AM, Meic said:

You may have multiple versions of python installed and pip is installing to a different version than "py" is using.

 

In the command prompt run:


where py

If you can also provide the output of:


path

then we can see if the location that pip is installing numpy (in your appdata) is in your path.

 

Capture.PNG

Link to comment
Share on other sites

Link to post
Share on other sites

8 hours ago, PorterG2003 said:

 

Capture.PNG

 

Ok, I think the issue is that you have two versions of python installed, one in c:\Windows and one in c:\Users\porte\AppData\... Numpy is being installed to the version in  c:\Users\porte\AppData\... but when you run python you are calling the installation in c:\Windows

 


Could you try running:

C:\Users\porte\AppData\Local\Programs\Python36-32\python.exe 2layerNeuralNetwork.py

Hopefully this should run using the version of python that has numpy installed.

 

 

 

For a better/longer term solution, I would suggest setting up a virtual environment (https://virtualenv.pypa.io/en/stable/userguide/) and using that for running python scripts on windows. There is a simple tutorial here: http://programwithus.com/learn-to-code/Pip-and-virtualenv-on-Windows/ or many more a google search away.

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×