当我尝试在spyder (版本2.2)中导入slycot模块时,我得到以下错误:
RuntimeError: module compiled against API version 7 but this version of numpy is 6
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/slycot/__init__.py",
line 4, in <module>
from slycot.analysis import ab01nd,ab05md,ab05nd,ab07nd,ab08nd, ab09ad
File "/Applications/Spyder.app/Contents/Resources/lib/python2.7/slycot/analysis.py",
line 21, in <module>
from slycot import _wrapper
ImportError: numpy.core.multiarray failed to import
现在,当我通过我的终端在python shell中导入slycot时,完全没有问题。我认为终端没有问题的原因是我最近安装了numpy 1.7.1。另一方面,Spyder仍然使用numpy 1.6.2,因此出现了错误。
我试着改变spyder中的numpy版本,但到目前为止都不起作用。当我用最近安装的numpy(7)更改spyder库中的numpy(6)文件夹时,我得到以下错误(在spyder中):
ImportError: Error importing numpy: you should not try to import numpy from
its source directory; please exit the numpy source tree, and relaunch
your python intepreter from there.
解决此错误的最佳方法是什么?
提前谢谢。
发布于 2013-05-24 20:32:15
(这里是Spyder dev )目前,用户不可能在应用程序中安装任何东西。我猜你把你的slycot模块从另一个解释器移到了我们的应用程序上(因为你提到的numpy
错误)。
使用应用程序中不存在的不同模块的正确方法是在以下位置更改解释器的路径:
工具>首选项>控制台>高级设置> Python可执行文件
如果使用系统Python安装slycot,则必须选择
/usr/bin/python
https://stackoverflow.com/questions/16740991
复制