簡體   English   中英

Python-無法在spyder中導入slycot模塊(RuntimeError&ImportError)

[英]Python - cannot import slycot module in spyder (RuntimeError & ImportError)

當我嘗試在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 lib中的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.

解決此錯誤的最佳方法是什么?

提前致謝。

(此處為Spyder開發人員)目前,用戶無法在應用程序內安裝任何內容。 我猜您將slycot模塊從另一個解釋器移到了我們的App(因為您提到的numpy錯誤)。

使用應用程序中未提供的不同模塊的正確方法是在以下位置更改解釋器的路徑:

工具>首選項>控制台>高級設置> Python可執行文件

如果使用系統Python安裝了slycot,則必須選擇

/usr/bin/python

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM