mlabwrap设置Mac OS X

时间:2016-07-07 21:01:48

标签: python matlab install mlabwrap

我一直在尝试安装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变量,因为我对线程中给出的建议感到有些困惑。任何见解都会非常感激!

1 个答案:

答案 0 :(得分:0)

要安装mlabwrap,必须将setup.py文件修改为:

MATLAB_COMMAND = '/Applications/MATLAB_R2015a.app/bin/matlab'     # specify a full path if not in PATH
MATLAB_VERSION = 7.3      # e.g: 6 (one of (6, 6.5, 7, 7.3))
                            #      7.3 includes later versions as well
MATLAB_DIR= '/Applications/MATLAB_R2015a.app/'           # e.g: '/usr/local/matlab'; 'c:/matlab6'
PLATFORM_DIR='maci64'           # e.g: 'glnx86'; r'win32/microsoft/msvc60'
EXTRA_COMPILE_ARGS=None     # e.g: ['-G']

参数可能会根据您使用的MATLAB版本以及您正在使用的操作系统而改变。