无法在CentOS机器上导入pandas

时间:2017-11-10 14:24:38

标签: python linux pandas centos6

导入pandas时我遇到错误:

>>> import pandas as pd
**RuntimeError: module compiled against API version 6 but this version of numpy is 4**
numpy.core.multiarray failed to import
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib64/python2.6/site-packages/pandas/__init__.py", line 6, in <module>
    from . import hashtable, tslib, lib
ImportError: numpy.core.multiarray failed to import

尝试将numpy模块升级到最新版本。 得到以下信息:

[abc]# yum install numpy

Loaded plugins: fastestmirror, refresh-packagekit, security
Setting up Install Process
Loading mirror speeds from cached hostfile
* base: centos.excellmedia.net
* extras: centos.excellmedia.net
* updates: centos.excellmedia.net
**Package numpy-1.4.1-9.el6.x86_64 already installed and latest version**

是否有任何手动解决此问题?

1 个答案:

答案 0 :(得分:0)

模块对你的导入请求的回答似乎是非常自我解释的。你试过吗

yum update numpy

如果这不能解决您的问题(我不知道您的centos发行版使用的是什么回馈),您可以随时尝试点子方法

pip install -U numpy 

如果仍然无法解决您的问题,您可能会安装多个版本的numpy,您应该尝试this question的答案。