我在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.
答案 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扩展