2012-10-15 12 views
5

Sto tentando di aggiornare/aggiornare il mio NumPy, ma sto fallendo. Penso che potrei avere più versioni di NumPy installate in diverse directory, ma python per impostazione predefinita ne importa una vecchia. Qualsiasi aiuto?NumPy non eseguirà l'aggiornamento da 1.5.1 a 1.6.2 su OS X 10.7

Qui è dove la mia Python è:

Gonzo-vs-Kitties:~ brian$ which python 
/Library/Frameworks/Python.framework/Versions/2.7/bin/python 

Ecco la versione che Python importazioni:

Gonzo-vs-Kitties:~ brian$ python 
Python 2.7.3 (v2.7.3:70274d53c1dd, Apr 9 2012, 20:52:43) 
[GCC 4.2.1 (Apple Inc. build 5666) (dot 3)] on darwin 
Type "help", "copyright", "credits" or "license" for more information. 
>>> import numpy 
>>> print numpy.__version__ 
1.5.1 
>>> 

Ora uso easy_install aggiornare NumPy:

Gonzo-vs-Kitties:~ brian$ sudo easy_install --upgrade numpy 
Searching for numpy 
Reading http://pypi.python.org/simple/numpy/ 
Reading http://numpy.scipy.org 
Reading http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103 
Reading http://numeric.scipy.org 
Best match: numpy 1.6.2 
Processing numpy-1.6.2-py2.7-macosx-10.7-intel.egg 
numpy 1.6.2 is already the active version in easy-install.pth 
Installing f2py script to /usr/local/bin 

Using /Library/Python/2.7/site-packages/numpy-1.6.2-py2.7-macosx-10.7-intel.egg 
Processing dependencies for numpy 
Finished processing dependencies for numpy 

Anche dopo l'aggiornamento , NumPy è ancora la vecchia versione:

>>> import numpy 
>>> print numpy.__version__ 
1.5.1 
>>> 

Questo è il mio sys.path:

>>> print sys.path 
['', '/Library/Python/2.7/site-packages/nose-1.2.1-py2.7.egg', '/Library/Python/2.7/site-packages/virtualenv-1.8.2-py2.7.egg', '/Users/brian/Code/trac/genshi-trunk', '/Users/brian/Code/trac/trac-trunk', '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python', '/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Python/2.7/site-packages/pip-1.2.1-py2.7.egg', '/Library/Python/2.7/site-packages/numpy-1.6.2-py2.7-macosx-10.7-intel.egg', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python27.zip', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-darwin', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/plat-mac/lib-scriptpackages', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-tk', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-old', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/lib-dynload', '/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/site-packages', '/Library/Python/2.7/site-packages'] 

Tutte le idee?

+0

Solitamente per cose del genere, virtualenv è sorprendente. Puoi semplicemente creare una nuova venv e installare una nuova versione di qualsiasi cosa senza preoccuparti che le cose vengano importate correttamente, conflitti, ecc. E se qualcosa va storto, è molto più facile da risolvere. – miki725

risposta

4

Controllare il percorso del pacchetto NumPy:

import numpy 
print numpy.__path__ 

e verificare se si tratta di quello appena installato.

+0

Non è quello che ho appena installato. l'attributo __path__ punta a "/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy" Idee su come affrontarlo? – BMS

+0

Rimuovere la vecchia versione di numpy o aggiornarlo – waitingkuo

+1

Quando utilizzo pip e/o easy_install per installare, rimuove il mio più recente 1.6.2 NumPy e ignora completamente il NumPy 1.5.1. Come posso disinstallare una versione che il programma di disinstallazione non può vedere? – BMS