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
246k19 gold badges205 silver badges282 bronze badges
asked Nov 29, 2013 at 19:56
2
  • 1
    This seems to be a compatibility issue. Which ML-Version, which python version and which OS? Commented 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.. Commented Dec 2, 2013 at 16:54

1 Answer 1

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.

answered Dec 11, 2013 at 0:31
Sign up to request clarification or add additional context in comments.

1 Comment

in the last version, you can use this patch sourceforge.net/p/pymatlab/tickets/2 (so far the patch is not in the release)

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.