我个人对 Octave 并不熟悉,但似乎我已经帮助解决了这个问题。对于将来可能偶然发现此问题的其他人,以下是导致解决方案的过程:
鉴于错误Please install GNU Octave and put it in your path
,我搜索了源代码并从 _utils.py 中找到了这个:
try:
cmd = 'octave -q --braindead'
session = subprocess.Popen(cmd, shell=True,
stderr=subprocess.STDOUT,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
preexec_fn=os.setsid)
except OSError:
octave_path = glob('c:/Octave/*/bin/octave.exe')[0]
if not os.path.exists(octave_path):
msg = ('Please install Octave at "c:/Octave" '
' or put it in your path:\n'
'setx PATH "%PATH%;<path-to-octave-bin-dir>"')
raise Oct2PyError(msg)
else:
cmd = 'octave -q --braindead'
session = subprocess.Popen(cmd, shell=True,
stderr=subprocess.STDOUT,
stdin=subprocess.PIPE,
stdout=subprocess.PIPE,
preexec_fn=os.setsid)
except OSError:
raise Oct2PyError('Please put the Octave executable in your PATH')
return session
因此,当octave -q --braindead
尝试命令并失败时会引发此问题
接下来我问 OP 命令是否在命令行上正确运行,以隔离问题。运行它,OP学到了:MSYS shell available C:\Software\Octave-3.6.4\msys
包括在路径中是解决方案
tl;博士
路径不应该只是
C:\Software\Octave-[version]\bin
反而
C:\Software\Octave-[version]\msys