title: Call Matlab2013 from Python3.x on Windows 7x64
body: <p>Task: Call a function from Matlab 2013b using Python 3.x on Windows 7 (all x64).</p>
  
  <p>Question: Is there a Python package that allows me to do that?</p>
  
  <p>I already tried: </p>
  
  <ul>
  <li>mlabwrap </li>
  <li>python-matlab-bridge</li>
  <li>pymatlab</li>
  </ul>
  
  <p>but none of these work with the configuration given above.</p>
  
  <p>Any information about a working configuration using Python 3.x is appreciated.</p>
  
  <p>If you need more detailed information, please let me know.</p>
  
  <hr>
  
  <p>Update: I am currently trying to get this working using Matlab2011b and Pyhton 2.7 as these seem to be the most used Versions. For now i am stuck at the following:</p>
  
  <p><strong><a href="https://github.com/arokem/python-matlab-bridge" rel="nofollow">python-matlab-bridge</a></strong>
  I can import the module without problems but as soon as is start a Session a Matlab Command Window pops up and nothing else happens. The Python Window shows: </p>
  
  <pre><code>Starting MATLAB on ZMQ socket tcp://127.0.0.1:55555
  Send 'exit' command to kill the server
  ............................................................Matlab session timed
   out after 60 seconds
  MATLAB failed to start
  Press any key to continue . . .
  </code></pre>
  
  <p>This happens every single time and no error is given.</p>
  
  <p><strong><a href="http://mlabwrap.sourceforge.net/" rel="nofollow">mlabwrap</a></strong>
  I tried to install mlabwrap <a href="http://obasic.net/how-to-install-mlabwrap-on-windows" rel="nofollow">using this guide</a>. On typing 'python setup.py install' a Matlab Command Window pops up and again nothing happens. If i close the Command Window the Python output shows:</p>
  
  <pre><code>WINDOWS SPECIFIC ISSUE? Unable to remove c:\users\martin\appdata\local\temp\tmp1
  y2kdk; please delete it manually
  [Error 32] Der Prozess kann nicht auf die Datei zugreifen, da sie von einem ande
  ren Prozess verwendet wird: 'c:\\users\\martin\\appdata\\local\\temp\\tmp1y2kdk'
  
  
  INSTALL ABORT: 'matlab -nodesktop -nosplash -wait -r "fid = fopen(\'c:\\users\\m
  artin\\appdata\\local\\temp\\tmp1y2kdk\', \'wt\');fprintf(fid, \'%s%c%s%c%s%c\',
   version, 10, matlabroot, 10, computer, 10);fclose(fid); quit"' RETURNED ERROR C
  ODE -805306369
  PLEASE MAKE SURE matlab IS IN YOUR PATH!
  </code></pre>
  
  <p>My <code>%Path%</code> looks like this (only the important parts ;):</p>
  
  <pre><code>D:\MATLAB\R2011b\bin;C:\Program Files\ZeroMQ 4.0.4\lib;D:\Python27;D:\Python27\scripts;D:\MATLAB\R2011b\runtime\win64;D:\MATLAB\R2011b\extern\lib\win64\microsoft;D:\MATLAB\R2011b\bin\win64
  </code></pre>
  
  <p>Any help to get any connection between Matlab and Python on Windows is appreciated! I really can´t see why none of this is working...</p>
  
  <hr>
  
  <p>Update2: I can install mlabwrap now but i can´t start it.
  When i try to import mlabwrap a Matlab Command Window opens up and closes after a minute.
  The Python output is: </p>
  
  <pre><code>&gt;&gt;&gt; import mlabwrap
  Traceback (most recent call last):
    File "&lt;stdin&gt;", line 1, in &lt;module&gt;
    File "D:\Python27\lib\site-packages\mlabwrap.py", line 645, in &lt;module&gt;
      mlab = MlabWrap()
    File "D:\Python27\lib\site-packages\mlabwrap.py", line 405, in __init__
      self._session = mlabraw.open(os.getenv("MLABRAW_CMD_STR", ""))
  mlabraw.error: Unable to start MATLAB(TM) engine
  </code></pre>
  
  <p>I double checked that the engdemo from Matlab is working.</p>