0

I'm teaching myself a little bit of programming in python and also matlab. And I need to run a couple of functions I wrote in python with matlab.

I've followed the basic install instructions for pymatlab and python(x,y). When I try to create a MATLAB session with the following code:

import pymatlab
session = pymatlab.session_factory()

I get the following error:

Exception AttributeError: "'MatlabSession' object has no attribute 'engine'" in <bound method MatlabSession.__del__ of <pymatlab.matlab.MatlabSession object at 0x03654AF0>> ignored

Traceback (most recent call last):
  File "<pyshell#1>", line 1, in <module>
    session = pymatlab.session_factory()
  File "C:\Python27\lib\site-packages\pymatlab\sessionfactory.py", line 51, in session_factory
    session = MatlabSession(path=basedir,bufsize=output_buffer_size)
TypeError: __init__() got an unexpected keyword argument 'path'

Help please!

eyllanesc
  • 190,383
  • 15
  • 87
  • 142
user3050521
  • 1
  • 1
  • 2
  • 1
    This seems to be a compatibility issue. Which ML-Version, which python version and which OS? – Daniel Nov 29 '13 at 20:44
  • Daniel, thanks for the quick response - I somehow missed it! I'm running a 64bit version of windows, but 32bit versions of MATLAB, Python, numpy, and pymatlab unfortunately. I believe the officially supported versions of numpy are 32bit.. – user3050521 Dec 02 '13 at 16:54

1 Answers1

2

It's a bug need fixed in windows platform. you can open the file "C:\Python27\lib\site-packages\pymatlab\sessionfactory.py" and locate the line 51, remove argument prefix "path="

MatlabSession(path=basedir,bufsize=output_buffer_size) 

Change into

MatlabSession(basedir,bufsize=output_buffer_size) 

Then you can enjoy your pymatlab.

samuel
  • 21
  • 1
  • in the last version, you can use this patch http://sourceforge.net/p/pymatlab/tickets/2/ (so far the patch is not in the release) – lib Sep 18 '14 at 11:22