Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/flash/4.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python-无法在spyder中导入slycot模块(RuntimeError和ImportError)_Python_Importerror_Spyder - Fatal编程技术网

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

Python-无法在spyder中导入slycot模块(RuntimeError和ImportError),python,importerror,spyder,Python,Importerror,Spyder,当我尝试在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/R

当我尝试在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
解决此错误的最佳方法是什么

提前感谢。

(此处为Spyder dev)目前用户无法在应用程序中安装任何内容。我猜您将slycot模块从另一个解释器移动到了我们的应用程序(因为您提到的
numpy
错误)

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

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

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


/usr/bin/python

安装后,通过复制Spyder库中的模块文件夹,我在Spyder中使用了不同的模块,如sympy、Tkinker等。到目前为止,这一切都很顺利。当我更改解释器的路径时,我得到以下消息:“python:posix_spawn:/System/Library/Frameworks/python.framework/Versions/2.7/Resources/python.app/Contents/MacOS/python:没有这样的文件或目录”我可能做错了什么,我还必须更改PYTHONSTARTUP吗?在终端中运行
哪个python
会得到什么?这是您需要放入Python可执行文件的路径,而不是您正在选择的路径。此外,该应用程序还附带Sympy和Tkinter。slycot的问题是,正如您正确猜测的那样,它是用不同的numpy版本编译的。我得到“/Library/Frameworks/Python.framework/Versions/2.7/bin/Python”,它已经尝试放入Python可执行文件中,但随后我得到错误:“ImportError:无法导入名称Uradom”。我试图找到一个解决方案来解决这个问题,但到目前为止还没有成功。您使用的Spyder版本是什么?Spyder 2.2.0dev(“Python 2.7.3,Qt 4.8.2,PyQt4(API v2)4.9.4 on Darwin”)
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.