如何在Windows上使用iPython Notebook解决熊猫的导入错误?
问题内容:
我正在尝试使用iPython导入熊猫。我的总体目的是使用XLwings。
我在Windows 7上,已使用Anaconda安装Python,熊猫和所有依赖项。
这是我的代码:
from pandas import DataFrame
这使:
ImportError Traceback (most recent call last)
<ipython-input-7-26dfcabfb474> in <module>()
----> 1 from pandas import DataFrame
C:\Users\Accounting\Anaconda\lib\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.
谁有在Windows上的iPython中使用Python / pandas的经验,可以帮助我了解如何解决此错误?
具体在哪里运行“ python setup.py build_ext –inplace”?
谢谢!
问题答案:
正如Jeff在评论中发布的那样:
(conda的)较早版本中存在一个错误,即如果您在使用大熊猫时更新了熊猫,则该熊猫无法正确更新。尝试关闭所有python进程,然后
conda remove pandas
conda install pandas