Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mac issues #2

Open
3rdcycle opened this issue May 20, 2014 · 2 comments
Open

mac issues #2

3rdcycle opened this issue May 20, 2014 · 2 comments

Comments

@3rdcycle
Copy link

Hi, I stumbled across a few issues while evaluating mlab for our project. For two of them I found the cause, on the third I gave up and moved on ;-). Anyway here's what I found, hope it helps. And sorry for reporting everything in one issue, but unfortunately I can't spend to much time on this.

  1. The mac system is not detected correctly in mlabraw.py since sys.platform returns "darwin" on the mac which obviously contains the string "win".
  2. The module always launches two instances of Matlab. I think it's because releases.py instantiates MLabWrap twice in get_mlab_instance.
  3. Every call to Matlab seems to hang while reading back the results. Here's the stack trace:
Error
Traceback (most recent call last):
  File "/.../mycode.py", line 61, in test_mlab
    mytest()
  File "/.../mycode.py", line 47, in run
    a = matlab.svd(np.array([[1, 2], [1, 3]]))
  File "/usr/local/lib/python2.7/site-packages/mlab/mlabwrap.py", line 607, in mlab_command
    return self._do(name, *args, **update({'nout':nout}, kwargs))
  File "/usr/local/lib/python2.7/site-packages/mlab/mlabwrap.py", line 547, in _do
    res = self._get_values(resSL)
  File "/usr/local/lib/python2.7/site-packages/mlab/mlabwrap.py", line 483, in _get_values
    res.append(self._get(varname))
  File "/usr/local/lib/python2.7/site-packages/mlab/mlabwrap.py", line 568, in _get
    vartype = self._var_type(varname)
  File "/usr/local/lib/python2.7/site-packages/mlab/mlabwrap.py", line 436, in _var_type
    res_type = mlabraw.get(self._session, "TMP_CLS__")
  File "/usr/local/lib/python2.7/site-packages/mlab/mlabraw.py", line 72, in get
    return matlab.get(var_name)
  File "/usr/local/lib/python2.7/site-packages/mlab/matlabpipe.py", line 250, in get
    self._read_until('start_binary\n', on_new_output=on_new_output)
  File "/usr/local/lib/python2.7/site-packages/mlab/matlabpipe.py", line 294, in _read_until
    raise MatlabConnectionError('timeout')
MatlabConnectionError: timeout
@ruozhichen
Copy link

I encountered the third problem, and its stack trace was totally same as yours. It shows mlab.matlabpipe.MatlabConnectionError:timeout.
It happened when I want to execute the following commands in Ubuntu:
from mlab.releases import latest_release as matlab
matlab.plot([1,2,3,4,5],-'o') #failed

But in Windows, it succeeded.
I tried to solve it, but found nothing.
If you have any suggestions, I will be very thankful.

@VividLe
Copy link

VividLe commented Aug 28, 2017

I encountered the same issue, and solved by following the official website instruction: https://cn.mathworks.com/help/matlab/matlab-engine-for-python.html

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants