导入熊猫时,我将得到以下错误:
Numpy.dtype has the wrong size, try recompiling
我正在运行Python 2.7.5、Pandas 0.14.1和Numpy 1.9.0。我试过使用pip安装这两个版本的旧版本,每次都有重大错误。当谈到Python时,我是一个初学者,因此非常感谢这里的任何帮助。:)
编辑:运行OS X 10.9.4
编辑2:这里有一个链接,指向我卸载并重新安装Numpy+Pandas的视频,然后运行一个.py文件:https://www.dropbox.com/s/sx9l288jijokrar/numpy%20issue.mov?dl=0
我以前见过这个错误,它通常与熊猫引用旧版本的numpy有关。但是如果python路径仍然指向旧版本的numpy,那么重新安装可能没有帮助。
当您通过pip安装numpy时,pip会告诉您它是在哪里安装的。有点像
所以你安装了正确版本的numpy。但是当你进入python
你的路径可能指向另一个核。
我找到的最简单的解决方案就是删除不需要的numpy版本(为了安全起见,将它移到一个_bak文件夹中)
现在当我开始使用python时
我有我想要的版本。
对于更复杂的工作流,不同的应用程序可能需要不同版本的不同包,virtualenvs是一个很好的方法。但我认为对于你只想让熊猫和小猫咪玩得很好的情况,这种方法应该会很好。
你应该试着把你的numpy升级到最新版本。这对我有效。
我也犯了同样的错误。我通过删除现有的numpy并重新安装解决了这个问题。
实际上,我不知道为什么会这样。我刚换了新版本。
相关问题 更多 >
编程相关推荐