Numpy is installed but still getting error

2020-06-30 05:01发布

问题:

I am trying to run jupyter notebook and getting following error. I am using Win 7 with anaconda python 3.7.

ImportError: Something is wrong with the numpy installation. While importing we detected an older version of numpy in ['c:\users\paperspace\anaconda3\envs\tensorflow10\lib\site-packages\numpy']. One method of fixing this is to repeatedly uninstall numpy until none is found, then reinstall this version.

I have followed the steps mentioned in the error but still not working.

回答1:

Run

pip3 uninstall numpy

until you receive a message stating no files available with numpy to uninstall and then you can freshly install numpy using

pip install numpy

and that will fix the issue.



回答2:

I was getting the error when I was trying to use Keras. This can be fixed by removing the numpy package continuously by running pip3 uninstall numpy. And checking the successful un-installation by opening a python terminal and importing numpy package.



回答3:

Remove the folder numpy and reinstall numpy. work for me. Code below

rm -rf ~/.local/lib/python3.6/site-packages/numpy
pip install numpy


回答4:

Use conda update --all

This works.



回答5:

per https://github.com/numpy/numpy/issues/12976, tried conda update -c defaults numpy and it worked. YMMV...



回答6:

This Means a Duplicated. Try pip uninstall numpy or pip3 uninstall numpy then sudo apt-get install python3-numpy

FOR (DEBIAN DIST)



回答7:

Besides all the other answers, you may try something like

yum erase numpy

is you intalled some python library using yum install or apt-get install



回答8:

Apparently, multiple versions of numpy is installed on the computer in the same python virtual environment. This is strange and never happened with any other packages. Uninstall all the packages and install numpy again. This should solve the problem.

Use pip to uninstall.

pip3 uninstall numpy 
# or
python3 -m pip uninstall numpy

Then install again. Preferably with the exact version number.

pip3 install numpy==1.18.4

I had to uninstall numpy thrice. Until I got the message WARNING: Skipping numpy as it is not installed.



回答9:

For me it was about the consoles used.

My cygwin terminal - NOPE, dos - NOPE, but console opened from Anaconda or Spyder etc... all commands (pip install etc) worked.