猿问

ValueError:numpy.dtype的大小错误,请尝试重新编译

我刚刚在python 2.7上安装了pandas和statsmodels软件包,当我尝试“将pandas导入为pd”时,出现此错误消息。有人可以帮忙吗?谢谢!!!


numpy.dtype has the wrong size, try recompiling

Traceback (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.p

y", 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", li

ne 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", line

14, 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


拉丁的传说
浏览 722回答 3
3回答

暮色呼如

对我来说(Mac OS X Maverics,Python 2.7)easy_install --upgrade numpy帮助。之后,您可以使用pip安装最新软件包pandas,scikit-learn等:pip install pandas

慕无忌1623718

我发现它是一个过时或不匹配的简单版本,并通过以下方式修复:pip install --upgrade numpypip install --upgrade scipypip install --upgrade pandas或者可以使用一种衬板:pip install --upgrade numpy scipy pandas
随时随地看视频慕课网APP

相关分类

Python
我要回答