我碰巧偶然发现了用户 brentlance 发布的关于将 Matlab 链接到 Python 的答案,我想知道我是否可以就 mlabwrap 模块的初始设置向社区寻求一些建议。
我在 Windows 7 32 位上,使用 Matlab R2012a 和 Python 2.7(来自 Python(x,y) 科学计算包)。当我尝试运行时:
python setup.py install
在 malbwrap 目录中,控制台返回一个非常大的错误,如下所示:
WINDOWS SPECIFIC ISSUE? Unable to remove c:\users\nathan\appdata\local\temp\tmpv
tzipc; please delete it manually
[Error 32] The process cannot access the file because it is being used by anothe
r process: 'c:\\users\\nathan\\appdata\\local\\temp\\tmpvtzipc'
running install
running build
running build_py
running build_ext
building 'mlabraw' extension
Traceback (most recent call last):
File "setup.py", line 189, in <module>
extra_compile_args=EXTRA_COMPILE_ARGS,
File "C:\Python27\lib\distutils\core.py", line 152, in setup
dist.run_commands()
File "C:\Python27\lib\distutils\dist.py", line 953, in run_commands
self.run_command(cmd)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\distutils\command\install.py", line 563, in run
self.run_command('build')
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\distutils\command\build.py", line 127, in run
self.run_command(cmd_name)
File "C:\Python27\lib\distutils\cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "C:\Python27\lib\distutils\dist.py", line 972, in run_command
cmd_obj.run()
File "C:\Python27\lib\distutils\command\build_ext.py", line 340, in run
self.build_extensions()
File "C:\Python27\lib\distutils\command\build_ext.py", line 449, in build_exte
nsions
self.build_extension(ext)
File "C:\Python27\lib\distutils\command\build_ext.py", line 499, in build_exte
nsion
depends=ext.depends)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 474, in compile
self.initialize()
File "C:\Python27\lib\distutils\msvc9compiler.py", line 384, in initialize
vc_env = query_vcvarsall(VERSION, plat_spec)
File "C:\Python27\lib\distutils\msvc9compiler.py", line 300, in query_vcvarsal
l
raise ValueError(str(list(result.keys())))
ValueError: [u'path']
为了应对各种其他问题,到目前为止,我尝试了以下方法:
- 我按照此处发布的安装指南进行操作
- 已安装 Microsoft VS Express 2010 和 SDK 版本 7.1
- 在 Matlab 中将 SDK C++ 编译器设置为默认值
- 将 msvc9compiler.py 脚本 (C:\Python27\Lib\distutils\msvc9compiler.py) 指向我的 VS Express 安装的 Common Tools 文件夹,以避免出现“无法找到 vcvarsall.bat”错误,如此处所述。
你们可以提供的任何帮助将不胜感激。非常感谢。