2015-12-05 101 views
1

我在我的Mac Book Pro上使用Python 3.5。我使用 pip3 install pandas如果我打開ipython和運行 import pandas as pd我碰到下面的錯誤安裝的大熊貓。Python 3.5熊貓導入錯誤

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

的C擴展難道'PIP3安裝pandas'給任何錯誤消息? –

+2

使用Anaconda。其實,安裝Miniconda,然後運行'conda install pandas'。在Continnum.io,您的安心對他們非常重要。 – Kartik

回答

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/ 

要不然包含用於Pandas一個setup.py任何地方呢?

0

這裏嘗試/Library/Frameworks/Python.framework/Versions/3.5/lib/python3.5/site-packages/pandas/運行python setup.py build_ext --inplace打造大熊貓

+0

在熊貓或其他任何地方都找不到'setup.py'。 – liv2hak

+0

確保你已經爲XCode **安裝了Xcode和**命令行工具,然後嘗試重新安裝它的熊貓。如果仍然沒有工作嘗試運行我上面說的 – mehdy

+0

命令如何做到這一點在Mac書? – liv2hak