为什么pip show告诉我我有numpy版本1.13.1,而Pandas认为我有numpy版本1.8.0rc1
导入熊猫时出现以下错误。有人能告诉我怎么解决这个问题吗。在
进口熊猫
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Library/Python/2.7/site-packages/pandas/__init__.py", line 23, in <module>
from pandas.compat.numpy import *
File "/Library/Python/2.7/site-packages/pandas/compat/numpy/__init__.py", line 24, in <module>
'this pandas version'.format(_np_version))
ImportError: this version of pandas is incompatible with numpy < 1.9.0
your numpy version is 1.8.0rc1.
Please upgrade numpy to >= 1.9.0 to use this pandas version
这些是我机器上的numpy的详细信息
pip show numpy
Name: numpy
Version: 1.13.3
Summary: NumPy: array processing for numbers, strings, records, and objects.
Home-page: http://www.numpy.org
Author: NumPy Developers
Author-email: numpy-discussion@python.org
License: BSD
Location: /Library/Python/2.7/site-packages
这些是我机器上熊猫的细节
Name: pandas
Version: 0.21.1
Summary: Powerful data structures for data analysis, time series,and statistics
Home-page: http://pandas.pydata.org
Author: The PyData Development Team
Author-email: pydata@googlegroups.com
License: BSD
Location: /Library/Python/2.7/site-packages
Requires: pytz, python-dateutil, numpy
我尝试过卸载和重新安装numpy
sudo pip uninstall numpy
sudo pip install numpy
我已经检查过熊猫是否有任何依赖问题
pip check pandas
No broken requirements found.
我试过取消和重新链接numpy
brew unlink numpy
brew link numpy
Linking /usr/local/Cellar/numpy/1.13.3...
Error: Could not symlink bin/f2py
Target /usr/local/bin/f2py
already exists. You may want to remove it:
rm '/usr/local/bin/f2py'
To force the link and overwrite all conflicting files:
brew link --overwrite numpy
To list all files that would be deleted:
brew link --overwrite --dry-run numpy
在pythonrepl中(我使用ipython)
这会告诉你纽姆是从哪里来的,对熊猫来说就是这样
^{pr2}$在终端窗口中输入
echo $PATH
相关问题 更多 >
编程相关推荐