简体   繁体   English

OS X未使用最新的NumPY版本

[英]OS X not using most recent NumPY version

Trying to update NumPY by running pip install -U numpy , which yields "Requirement already up-to-date: numpy in /Library/Python/2.7/site-packages". 尝试通过运行pip install -U numpy来更新NumPY,这会产生“需求已经是最新的:/Library/Python/2.7/site-packages中的numpy”。 Then checking the version with import numpy and numpy.version.version yields '1.6.2' (old version). 然后使用import numpynumpy.version.version检查版本numpy.version.version产生“ 1.6.2”(旧版本)。 Python is importing numpy via the path '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy'. Python正在通过路径'/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy'导入numpy。 Please help me out here. 请帮我在这里。

You can remove the old version of numpy from 您可以从以下位置删除旧版本的numpy:

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

.
Just delete the numpy package from there and then try to import numpy from the python shell. 只需从那里删除numpy软件包,然后尝试从python shell导入numpy。

The new NumPY version would install (via pip) into the System path, where it wasn't being recognized by Python. 新的NumPY版本将(通过pip)安装到系统路径中,Python不会识别该路径。 To solve this I ran pip install --user numpy==1.7.1 to specify I want NumPY version 1.7.1 on my Python (user) path. 为了解决这个问题,我运行了pip install --user numpy==1.7.1来指定我想要Python(用户)路径上的NumPY版本1.7.1。 :) :)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM