0

I am using a ipython conda python 2.7 virtual environment.

After a suggestion of a probable conflict between conda numpy and pip numpy, i uninstalled the "pip numpy" using pip uninstall numpy.

When I try importing numpy, i now get the following error :

ImportError: No module named numpy

If i execute conda list in my environment, i get

... [list of other packages]
numpy                     1.11.3                   py27_0
...

which seems to indicate that conda numpy package is still installed. I also can't install numpy using conda install, which says that 'All requested packages already installed.'

a print sys.path will result in

'', '/home/<user>/anaconda3/envs/py27/lib/python27.zip', '/home/<user>/anaconda3/envs/py27/lib/python2.7', '/home/<user>/anaconda3/envs/py27/lib/python2.7/plat-linux2', '/home/<user>/anaconda3/envs/py27/lib/python2.7/lib-tk', '/home/<user>/anaconda3/envs/py27/lib/python2.7/lib-old', '/home/<user>/anaconda3/envs/py27/lib/python2.7/lib-dynload', '/home/<user>/anaconda3/envs/py27/lib/python2.7/site-packages', '/home/<user>/anaconda3/envs/py27/lib/python2.7/site-packages/Sphinx-1.5.1-py2.7.egg', '/home/<user>/anaconda3/envs/py27/lib/python2.7/site-packages/setuptools-27.2.0-py2.7.egg'

Can anyone explain me why i cant use the numpy package listed in the conda packages ?

Thank you !

Skyba
  • 11
  • 1
  • 2
  • have you tried uninstalling the conda numpy then reinstalling using pip? – DrBwts Feb 02 '17 at 14:12
  • @DrBwts i did, and then numpy works fine. However this gets me back to my original problem, which is the same as the one explained in https://stackoverflow.com/questions/36190757/numpy-undefined-symbol-pyfpe-jbuf. I suspect that this is linked to the pip version of numpy, which is why i am trying to use the conda numpy instead. – Skyba Feb 02 '17 at 14:28

2 Answers2

3

I had the same issue. What helped for me was to force anaconda to reinstall the package with:

conda install numpy --force
Phil.
  • 31
  • 3
  • This is correct, except the version, it is not required indeed. I had similar problem, having both numpy from conda and python, and after `pip uninstall numpy`, even htough `conda list` still showed both `numpy` version I could not load it. Only after `conda install numpy --force` I could (no need to specifiy version). – H. Rev. Mar 27 '18 at 08:59
0

If you are using 64-bit python3 conda then numpy package is installed default for python3, since you are using python2 you have to do the following steps:

first open anaconda prompt then type conda info --envs . It displays the environments installed and the environment adjacent to which * is found is the default environment. Activate the desired environment by typing activate environmentname. After that type comment

conda install numpy.
King Julien
  • 159
  • 17
abhi ram
  • 1
  • 1