Python numpy update from 1.6 to 1.8

I installed numpy 1.8. But when I type numpy.__version__, he says 1.6.

What do I need to change to make python understand where numpy is? Work on Mac (10.9). I am using python 2.7.6.

Edit:

I tried uninstalling all my numpy versions. I removed the numpy pudding. And then I typed:

python import numpy print numpy. version

and he printed 1.6.2

I can't remove numpy, apparently.

+4
source share
3 answers

I am running Python 2.7.5 on Mac OS X 10.9.4, and this seems to be some kind of weird bug in the way the Macintosh factory-installed version of Python handles updated package installations.

, :

sudo pip uninstall numpy

numpy,

/Library/Python/2.7/site-packages

, numpy ! "" Python, :

/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python

numpy /usr/bin/easy_install, Apple OS X, ( 1.9.0, ) numpy Library/Python/2.7/site-packages, , numpy "OS X system default" , numpy , import numpy Python. - , -, ! - numpy pip, :

sudo python setup.py install

.tar.gz, sourceforge, , , Python, /Library/Python/2.7/site-packages!

, (, , , , Max OS X), :

  • numpy /Library/Python/2.7/site-packages (pip uninstall numpy, , )
  • , , /Library/Python/2.7/site-packages
  • numpy factory -included /usr/bin/easy_install. , , numpy Apple factory - Python 2.7

Python (, Canopy Anaconda), , .

+8

, . , , easy_install , easy_install -m . , ( sys.path, , , ).

python :

>>> import numpy
>>> numpy.__file__
'/home/wim/.virtualenvs/xyz/local/lib/python2.7/site-packages/numpy/__init__.pyc'

, , .

"" numpy, .

+2

I assume you have an inconsistent version of numpy in two ways

/Library/Python/2.7/site-packages

and

/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python

My solution renames (or deletes) one that you don't like (possibly an older version), and symbolically links to another (newer version) back to the directory from which you deleted the numpy folder.

+2
source

Source: https://habr.com/ru/post/1534674/


All Articles