Python 3.5 Pandas导入错误

时间:2015-12-05 06:41:42

标签: python pandas

我在Mac Book Pro上使用Python 3.5。我用pandas安装了 pip3 install pandas如果我打开ipython并运行 import pandas as pd我收到以下错误。

ImportError                               Traceback (most recent call last)
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/__init__.py in <module>()
      6 try:
----> 7     from pandas import hashtable, tslib, lib
      8 except ImportError as e:  # pragma: no cover

ImportError: cannot import name 'hashtable'

During handling of the above exception, another exception occurred:

ImportError                               Traceback (most recent call last)
<ipython-input-1-af55e7023913> in <module>()
----> 1 import pandas as pd

/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/__init__.py in <module>()
     11                       "pandas from the source directory, you may need to run "
     12                       "'python setup.py build_ext --inplace' to build the C "
---> 13                       "extensions first.".format(module))
     14 
     15 from datetime import datetime

ImportError: C extension: 'hashtable' 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.

2 个答案:

答案 0 :(得分:0)

错误消息显示

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.

你有没有试过在

运行它
/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/

setup.py包含Pandas的其他任何地方?

答案 1 :(得分:0)

尝试在此python setup.py build_ext --inplace运行/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/以构建pandas的C扩展