pandas - Python numpy 从1.6更新到1.9
迷茫
迷茫 2017-04-17 13:33:26
0
3
599

OSX 10.9
使用pip install -U numpy 更新numpy后
pip list | grep numpy查看pip管理的numpy版本,显示为numpy (1.9.0)。
但在终端启动python执行

>>> import numpy
>>> print numpy.__version__
1.6.0

请问如何让python使用1.9.0的numpy?

Edit
1.系统存在多个版本的numpy,某些原因让python优先使用了1.6版本的numpy
2.numpy低版本问题让import pandas 报错

解决方法:

>>> import numpy
>>> print numpy.__version__
1.6.0
>>> print(numpy)
<module 'numpy' from '/System/Library/Frameworks/Python.framework/Versions/2.7/Extras/lib/python/numpy/__init__.pyc'>

去目标文件夹删除该numpy文件,再次启动python
numpy的版本就是最新的1.9

>>> import numpy
>>> print numpy.__version__
1.9.0
>>> print(numpy)
<module 'numpy' from '/Library/Python/2.7/site-packages/numpy/__init__.pyc'>
迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(3)
阿神

Install a virtualenv, so that multiple versions of the library can exist at the same time.

Ty80

pyenv[https://github.com/yyuu/pyenv]

PHPzhong

Use conda in Anaconda to manage multiple environments

For reference:
http://conda.pydata.org/docs/using/envs.html#create-a-separate-environment

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!