为了账号安全,请及时绑定邮箱和手机立即绑定

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

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

慕盖茨4494581 2019-12-15 12:08:26
我刚刚在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 回答

?
慕村9548890

TA贡献1884条经验 获得超4个赞

对我来说(Mac OS X Maverics,Python 2.7)


easy_install --upgrade numpy

帮助。之后,您可以使用pip安装最新软件包pandas,scikit-learn等:


pip install pandas



查看完整回答
反对 回复 2019-12-16
?
守候你守候我

TA贡献1802条经验 获得超10个赞

我发现它是一个过时或不匹配的简单版本,并通过以下方式修复:


pip install --upgrade numpy

pip install --upgrade scipy

pip install --upgrade pandas

或者可以使用一种衬板:


pip install --upgrade numpy scipy pandas



查看完整回答
反对 回复 2019-12-16
  • 3 回答
  • 0 关注
  • 451 浏览
慕课专栏
更多

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号