[英]Pandas not properly installed in venv
在带有Python 2.7.12
ubuntu 2.7.12
,我试图在virtualenv
使用pip
安装pandas
和其他软件包。 安装过程没有任何错误。 但是,当我尝试导入熊猫时,出现以下错误:
RuntimeError: module compiled against API version 0xc but this version of numpy is 0xa
Traceback (most recent call last):
...
import pandas as pd
File "/usr/local/lib/python2.7/dist-packages/pandas/__init__.py", line 31, in <module>
"extensions first.".format(module))
ImportError: C extension: umpy.core.multiarray failed to import not built. If you want to import pandas from the source directory, you may need to run 'python setup.py build_ext --inplace' to build the C extensions first.
我的系统具有相同版本的熊猫( 0.18.0
),并且可以正常运行。
我尝试过但没有奏效的内容:
--system-site-packages
选项创建一个新的virtualenv。 更新numpy
版本:
pip install numpy --upgrade
应该修复错误。
这看起来像与此https://github.com/pandas-dev/pandas/issues/18530类似的问题,即numpy和pandas的某些特定版本之间不匹配。 pip install numpy --upgrade
对我不起作用,但是
python -m pip install pandas==0.18.0 --force-reinstall --upgrade --no-deps --no-cache
在我的案例中做到了这一点(我在新的Ubuntu 17.10,python2上遇到了这个问题)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.