user3820991
user3820991

Reputation: 2610

pywintypes.com_error using mlab

I want to call matlab from python using mlab. When I do the following

from mlab.releases import R2012a as matlab

I get the following error:

Exception AssertionError: AssertionError() in <bound method MlabWrap.__del__ of <mlab.mlabwrap.MlabWrap object at 0x000000000A7AC9B0>> ignored
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\Anaconda\lib\site-packages\mlab\releases.py", line 125, in __getattr__
return self.instances[name]
  File "C:\Anaconda\lib\site-packages\mlab\releases.py", line 63, in __getitem__
self[k] = self.get_mlab_instance(k)
  File "C:\Anaconda\lib\site-packages\mlab\releases.py", line 87, in get_mlab_instance
instance = MlabWrap()
  File "C:\Anaconda\lib\site-packages\mlab\mlabwrap.py", line 405, in __init__
self._session = mlabraw.open()
  File "C:\Anaconda\lib\site-packages\mlab\mlabraw.py", line 44, in open
ret.open()
  File "C:\Anaconda\lib\site-packages\mlab\matlabcom.py", line 62, in open
self.client = win32com.client.Dispatch('matlab.application')
  File "C:\Anaconda\lib\site-packages\win32com\client\__init__.py", line 95, in Dispatch
dispatch, userName = dynamic._GetGoodDispatchAndUserName(dispatch,userName,clsctx)
  File "C:\Anaconda\lib\site-packages\win32com\client\dynamic.py", line 114, in _GetGoodDispatchAndUserName
return (_GetGoodDispatch(IDispatch, clsctx), userName)
  File "C:\Anaconda\lib\site-packages\win32com\client\dynamic.py", line 91, in _GetGoodDispatch
IDispatch = pythoncom.CoCreateInstance(IDispatch, None, clsctx, pythoncom.IID_IDispatch)
pywintypes.com_error: (-2147221008, 'CoInitialize wurde nicht aufgerufen.', None, None)

The displayed error at the end says in German 'CoInitialize was not called'. I have no idea what to do. Any help to trace the error would be much appreciated.

EDIT: I have MATLAB R2012a 64bit installed on Windows 7 64bit.

Upvotes: 0

Views: 327

Answers (0)

Related Questions