我刚刚在python 2.7上安装了pandas和statsmodels软件包,当我尝试“将pandas导入为pd”时,出现此错误消息。有人可以帮忙吗?谢谢!!!numpy.dtype has the wrong size, try recompilingTraceback (most recent call last): File "<stdin>", line 1, in <module> File "C:\analytics\ext\python27\lib\site-packages\statsmodels-0.5.0-py2.7-win32.egg\statsmodels\formula\__init__.py",line 4, in <module> from formulatools import handle_formula_data File "C:\analytics\ext\python27\lib\site-packages\statsmodels-0.5.0-py2.7-win32.egg\statsmodels\formula\formulatools.py", line 1, in <module> import statsmodels.tools.data as data_util File "C:\analytics\ext\python27\lib\site-packages\statsmodels-0.5.0-py2.7-win32.egg\statsmodels\tools\__init__.py", line 1, in <module> from tools import add_constant, categorical File "C:\analytics\ext\python27\lib\site-packages\statsmodels-0.5.0-py2.7-win32.egg\statsmodels\tools\tools.py", line14, in <module> from pandas import DataFrame File "C:\analytics\ext\python27\lib\site-packages\pandas\__init__.py", line 6, in <module> from . import hashtable, tslib, lib File "numpy.pxd", line 157, in init pandas.tslib (pandas\tslib.c:49133)ValueError: numpy.dtype has the wrong size, try recompiling
3 回答
暮色呼如
TA贡献1853条经验 获得超9个赞
对我来说(Mac OS X Maverics,Python 2.7)
easy_install --upgrade numpy
帮助。之后,您可以使用pip安装最新软件包pandas,scikit-learn等:
pip install pandas
慕无忌1623718
TA贡献1744条经验 获得超4个赞
我发现它是一个过时或不匹配的简单版本,并通过以下方式修复:
pip install --upgrade numpy
pip install --upgrade scipy
pip install --upgrade pandas
或者可以使用一种衬板:
pip install --upgrade numpy scipy pandas
添加回答
举报
0/150
提交
取消