0

在导入 oct2py 模块时,我得到了..

>>> import oct2py

Traceback (most recent call last):
  File "<pyshell#0>", line 1, in <module>
    import oct2py
  File "C:\Python27\lib\site-packages\oct2py\__init__.py", line 38, in <module>
    octave = Oct2Py()
  File "C:\Python27\lib\site-packages\oct2py\core.py", line 73, in __init__
    self.restart()
  File "C:\Python27\lib\site-packages\oct2py\core.py", line 508, in restart
    logger=self.logger)
  File "C:\Python27\lib\site-packages\octave_kernel\kernel.py", line 144, in __init__
    self.repl = self._create_repl()
  File "C:\Python27\lib\site-packages\octave_kernel\kernel.py", line 338, in _create_repl
    version = subprocess.check_output(version_cmd).decode('utf-8')
  File "C:\Python27\lib\subprocess.py", line 566, in check_output
    process = Popen(stdout=PIPE, *popenargs, **kwargs)
  File "C:\Python27\lib\subprocess.py", line 710, in __init__
    errread, errwrite)
  File "C:\Python27\lib\subprocess.py", line 958, in _execute_child
    startupinfo)
WindowsError: [Error 2] The system cannot find the file specified

我搜索了更多线程,他们谈到了子处理 python shell,但我不知道该怎么做。所以有人请帮我解决这个问题。

4

1 回答 1

1

当我将错误的目录添加到 PATH 时,这发生在我身上。我添加 C:\Octave\Octave-4.2.1\ 而不是正确的 C:\Octave\Octave-4.2.1\bin\.

在导入 oct2py 时,它会查找\bin目录中的 octave-cli.exe 可执行文件。

另请参阅如何在 Windows 8 的 PATH 环境变量中添加 Octave?

于 2017-06-16T16:29:49.283 回答