我一直在尝试安装 mlabwrap Python 库,但是当我在终端中使用命令 python setup.py install 运行 setup.py 文件时继续遇到以下错误:
Traceback (most recent call last):
File "setup.py", line 130, in <module>
queried_version, queried_dir, queried_platform_dir = matlab_params(cmd, WINDOWS, extra_args)
File "setup.py", line 93, in matlab_params
error = call(cmd, **extra_args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 522, in call
return Popen(*popenargs, **kwargs).wait()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 710, in __init__
errread, errwrite)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/subprocess.py", line 1335, in _execute_child
raise child_exception
OSError: [Errno 2] No such file or directory
我做了一些调查,发现以下论坛帖子:https ://sourceforge.net/p/mlabwrap/mailman/message/29077359/来解决这个问题。按照此线程中的建议,我在 setup.py 文件中更改了以下内容:
__version__ = '7.3'
和
MATLAB_DIR = '/Applications/MATLAB_R2015a.app'
我感觉问题与查找matlab所在的目录有关,但我似乎无法解决这个问题。我没有更改我的 $PATH 变量,因为我对线程中给出的建议有点困惑。任何见解将不胜感激!