首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >Python -无法在spyder (RuntimeError和ImportError)中导入slycot模块

Python -无法在spyder (RuntimeError和ImportError)中导入slycot模块
EN

Stack Overflow用户
提问于 2013-05-25 02:01:06
回答 1查看 1.2K关注 0票数 0

当我尝试在spyder (版本2.2)中导入slycot模块时,我得到以下错误:

代码语言:javascript
运行
复制
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中):

代码语言:javascript
运行
复制
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.

解决此错误的最佳方法是什么?

提前谢谢。

EN

回答 1

Stack Overflow用户

发布于 2013-05-25 04:32:15

(这里是Spyder dev )目前,用户不可能在应用程序中安装任何东西。我猜你把你的slycot模块从另一个解释器移到了我们的应用程序上(因为你提到的numpy错误)。

使用应用程序中不存在的不同模块的正确方法是在以下位置更改解释器的路径:

工具>首选项>控制台>高级设置> Python可执行文件

如果使用系统Python安装slycot,则必须选择

/usr/bin/python

票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16740991

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档