在python-3.4 unix环境中导入熊猫时出错-未定义符号:pyobject_cmp
我使用的是Pandas版本0.16.1,工作正常,但我想将Pandas更新到版本0.16.2,所以我卸载了它,并使用在python-3.4 unix环境中导入熊猫时出错-未定义符号:pyobject_cmp,python,pandas,pip,Python,Pandas,Pip,我使用的是Pandas版本0.16.1,工作正常,但我想将Pandas更新到版本0.16.2,所以我卸载了它,并使用 pip uninstall pandas pip install pandas 安装似乎很好。然而,当我试图进口大熊猫时 import pandas 我得到一个错误: Traceback (most recent call last): File "path_to_python/python3.4/site-packages/pandas/__init__.py", line
pip uninstall pandas
pip install pandas
安装似乎很好。然而,当我试图进口大熊猫时
import pandas
我得到一个错误:
Traceback (most recent call last):
File "path_to_python/python3.4/site-packages/pandas/__init__.py", line 7, in <module>
from pandas import hashtable, tslib, lib
ImportError: path_to_python/python3.4/site-packages/pandas/hashtable.cpython-34m.so: undefined symbol: pyobject_cmp
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "path_to_python/python3.4/site-packages/pandas/__init__.py", line 13, in <module>
"extensions first.".format(module))
ImportError: C extension: path_to_python/python3.4/site-packages/pandas/hashtable.cpython-34m.so:
undefined symbol: pyobject_cmp 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.
也不起作用,因为找不到setup.py。错误是:
Fatal Python error: Py_Initialize: can't initialize sys standard streams
AttributeError: 'module' object has no attribute 'OpenWrapper'
Aborted (core dumped)
如果您对可能出现的问题有任何建议或见解,我们将不胜感激
更新:
我试图通过下载软件包从源代码处安装它:
python setup.py install
python setup.py build_ext --inplace
这一次,第二个命令生成了大量输出并成功完成。但是,当我尝试导入pandas时,仍然会遇到相同的错误。如果有人感兴趣,我无法使用pip安装pandas,但我改用miniconda并使用它安装了pandas,它工作正常。由于编译器标志,我无法使用clang构建pandas。默认情况下使用
C99
模型时发出叮当声,这会导致不正确地编译pandas中使用的inline
代码
import pandas
所以在我的例子中,CFLAGS=-fgnu89内联pip安装pandas--global option=build\u ext
成功了