windows环境中Python中调用matlab

1,安装matlab,此处版本是matlabr2009a.

2,安装python,此处版本是python3.2.2,将python的安装路径添加到环境变量PATH中。

3,尝试在cmd命令行中查看python解释器的运行状况,键入“python”,预期出现:

Python 3.2.2 (default, Sep  4 2011, 09:51:08) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>>


4,安装python的科学计算工具包:numpy

此处的版本是:numpy-1.6.1-win32-superpack-python3.2

安装成功的标志是,在python的解释器中键入如下命令:

>>> import numpy
>>> dir()

输出:

['__builtins__', '__doc__', '__name__', '__package__', 'numpy']


5,下载mlabwrap,官网对该工具的解释是:

Mlabwrap is a high-level python to Matlab® bridge that lets Matlab look like a normal python library.

此处的版本是mlabwrap1.1

cmd里切换到该文件夹,键入:python setup.py install


很有可能出现如下错误:

  File "setup.py", line 105
    except OSError, msg: # FIXME
                  ^
SyntaxError: invalid syntax


查官方说明:Since there are several popular C++ compilers under windows, you might have to tell setup.py which one you'd like to use (unless it's VC 7).

即要求安装C++编译器

setup.py中对Borland C++有支持,决定安装Borland C++。查wikipedia知道Borland C++的最高版本是Borland C++ 5.5,由Embarcadero提供支持,下载链接是:http://edn.embarcadero.com/article/20633 


[failed][future to do]

6.cmd 命令行试运行matlab:
matlab.exe -nodesktop -nosplash -r hello
其中nodesktop是不启动GUI,nosplash是不启动splash界面



你可能感兴趣的:(windows,python,cmd,matlab,编译器,Borland)