After I have reinstalled anaconda I can not import numpy anymore on Python3
import numpy as np
ModuleNotFoundError: No module named 'numpy'I have tried
pip install numpyI try to install it again I get:
pip install numpy
Requirement already satisfied: numpy in /anaconda3/lib/python3.7/site-packages (1.16.3) 3 3 Answers
This command worked for me
python3 -m pip install numpy You are using a conda environment to run your program. So you should run:
conda install numpyIf you use IDE like Pycharm, it will be easy to install packages by a mouse click (Install packages).
You probably have multiple numpy versions installed on your system and need to manually delete the old one.
1) Open Terminal and run:
pip list2) Remember or notate the numpy version from the list
3) Then run Python in Terminal or write and execute this code in your IDE:
import numpy
print(numpy)
print(numpy.__version__)4) This should print two lines: numpy package location + numpy version like this:
<module 'numpy' from '/usr/local/lib/python2.7/site-packages/numpy/__init__.pyc'>
1.16.15) If the numpy version reported here is different then the one reported by pip list then go to the numpy package location printed above and delete that package folder
6) Try importing numpy now. If you previously installed it, it should work. If you didn't install it then go and install it now. After installation all should work fine.