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
246k19 gold badges205 silver badges282 bronze badges
-
1This seems to be a compatibility issue. Which ML-Version, which python version and which OS?Daniel– Daniel2013年11月29日 20:44:38 +00:00Commented Nov 29, 2013 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– user30505212013年12月02日 16:54:56 +00:00Commented Dec 2, 2013 at 16:54
1 Answer 1
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.
Sign up to request clarification or add additional context in comments.
1 Comment
lib
in the last version, you can use this patch sourceforge.net/p/pymatlab/tickets/2 (so far the patch is not in the release)
default