[英]oct2py Import error: the system cannot find the file specified
我正在嘗試在我的python腳本之一中使用oct2py,我在C:\\Octave\\Octave-4.2.1
安裝了C:\\Octave\\Octave-4.2.1
並已將C:\\Octave\\Octave-4.2.1
到我的用戶帳戶的PATH變量中。 當我from oct2py import octave
運行時from oct2py import octave
以下錯誤:
Traceback (most recent call last):
File "C:\Users\CVanCleef\Desktop\cvancleef reconstruction\filterTestin.py", line 12, in <module>
from oct2py import octave
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\site-packages\oct2py\__init__.py", line 38, in <module>
octave = Oct2Py()
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\site-packages\oct2py\core.py", line 73, in __init__
self.restart()
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\site-packages\oct2py\core.py", line 508, in restart
logger=self.logger)
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\site-packages\octave_kernel\kernel.py", line 144, in __init__
self.repl = self._create_repl()
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\site-packages\octave_kernel\kernel.py", line 338, in _create_repl
version = subprocess.check_output(version_cmd).decode('utf-8')
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 316, in check_output
**kwargs).stdout
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 383, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 676, in __init__
restore_signals, start_new_session)
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 955, in _execute_child
startupinfo)
FileNotFoundError: [WinError 2] The system cannot find the file specified
編輯:將OCTAVE_EXECUTABLE添加到我的路徑后,我得到了錯誤
Traceback (most recent call last):
File "C:\Users\CVanCleef\Desktop\cvancleef reconstruction\filterTestin.py", line 12, in <module>
from oct2py import octave
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\site-packages\oct2py\__init__.py", line 38, in <module>
octave = Oct2Py()
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\site-packages\oct2py\core.py", line 73, in __init__
self.restart()
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\site-packages\oct2py\core.py", line 508, in restart
logger=self.logger)
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\site-packages\octave_kernel\kernel.py", line 144, in __init__
self.repl = self._create_repl()
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\site-packages\octave_kernel\kernel.py", line 338, in _create_repl
version = subprocess.check_output(version_cmd).decode('utf-8')
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 316, in check_output
**kwargs).stdout
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 383, in run
with Popen(*popenargs, **kwargs) as process:
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 676, in __init__
restore_signals, start_new_session)
File "C:\Users\CVanCleef\AppData\Local\Continuum\Anaconda3\lib\subprocess.py", line 955, in _execute_child
startupinfo)
PermissionError: [WinError 5] Access is denied
更改PATH變量后是否重新啟動系統?
在加載其他模塊並通過重新啟動系統解決該問題之前,我曾遇到過此問題。
通過添加路徑變量OCTAVE_EXECUTABLE並將OCTAVE_EXECUTABLE值設置為C:\\Octave\\Octave-4.2.1\\bin\\octave-cli.exe
了修復。 我還從PATH中刪除了八度音階參考
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.