NumPy不会在OS X 10.7上从1.5.1升级到1.6.2 [英] NumPy won't upgrade from 1.5.1 to 1.6.2 on OS X 10.7

查看:59
本文介绍了NumPy不会在OS X 10.7上从1.5.1升级到1.6.2的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试更新/升级我的NumPy,但是失败了.我想我可能在不同目录中安装了多个版本的NumPy,但是默认情况下python会导入一个旧版本.有帮助吗?

I am attempting to update/upgrade my NumPy, but am failing. I think I might have multiple versions of NumPy installed in different directories, but python by default imports an old one. Any help?

这是我的Python所在的地方

Here's where my Python is:

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

这是Python导入的版本:

Here's the version that Python imports:

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
>>>

现在我使用easy_install升级NumPy:

Now I use easy_install to upgrade 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

即使我升级后,NumPy仍然是旧版本:

Even after I upgrade, NumPy is still the old version:

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

这是我的sys.path:

This is my 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']

有什么想法吗?

推荐答案

检查numpy软件包的路径:

Check the path of your numpy package:

import numpy
print numpy.__path__

并检查它是否是您刚刚安装的那个.

And check whether it is the one you just installed.

这篇关于NumPy不会在OS X 10.7上从1.5.1升级到1.6.2的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆