transplant icon indicating copy to clipboard operation
transplant copied to clipboard

__instancecheck__ timeout

Open matthewbradford opened this issue 4 years ago • 3 comments

Hi, I am trying to just start a matlab instance with transplant.Matlab(), but the operation fails due to a recursion depth error.

Do you know what my problem is likely to be? I can run matlab from the command line and zeromq appears to be installed.

Thanks for your hard work!

matthewbradford avatar Jul 29 '20 09:07 matthewbradford

Could you show me the origin of the recursion (beginning of the stack trace)?

bastibe avatar Jul 30 '20 07:07 bastibe

With a bit more debugging, I found a different error that is perhaps caught earlier? My original stack trace was too long to fit in my terminal, and this one seems a bit more enlightening. It seems that the attached exception is raised and then transplant sits and waits for messages until it runs out of recursion.

It would seem that this is a zmq installation/path problem, so not likely to be your problem.

ERROR:root:thar she blows
Traceback (most recent call last):
  File "test.py", line 7, in <module>
    mat = transplant.Matlab()
  File "/usr/local/lib/python3.8/dist-packages/transplant/transplant_master.py", line 542, in __init__
    msgformat, zmq_address, self._locate_libzmq()
  File "/usr/local/lib/python3.8/dist-packages/transplant/transplant_master.py", line 711, in _locate_libzmq
    raise RuntimeError('could not locate libzmq for Matlab')
RuntimeError: could not locate libzmq for Matlab

For reference: the original trace

  File "/usr/local/lib/python3.8/dist-packages/transplant/transplant_master.py", line 180, in _wait_socket
    if self.process.poll() is not None:
  File "/usr/local/lib/python3.8/dist-packages/transplant/transplant_master.py", line 637, in __getattr__
    return self._get_global(name)
  File "/usr/local/lib/python3.8/dist-packages/transplant/transplant_master.py", line 92, in _get_global
    response = self.send_message('get_global', name=name)
  File "/usr/local/lib/python3.8/dist-packages/transplant/transplant_master.py", line 149, in send_message
    kwargs = self._encode_values(kwargs)
  File "/usr/local/lib/python3.8/dist-packages/transplant/transplant_master.py", line 187, in _encode_values
    if isinstance(data, (np.ndarray, np.number)):
RecursionError: maximum recursion depth exceeded in __instancecheck__

matthewbradford avatar Jul 30 '20 07:07 matthewbradford

How and where did you install libzmq?

Also, I don't understand how you got into the recursion. You shouldn't have a valid Matlab object if it can't find libzmq.

bastibe avatar Jul 30 '20 12:07 bastibe