gpt4 book ai didi

python - mlabwrap 设置 Mac OS X

转载 作者:太空宇宙 更新时间:2023-11-03 16:22:51 26 4
gpt4 key购买 nike

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

最佳答案

为了安装 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 版本以及操作系统而变化。

关于python - mlabwrap 设置 Mac OS X,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/38255203/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com