Error when start matlab engine

Open
#20 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
25/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
python
Domain
tooling

Research direction

Start by reproducing the reported matlab.engine.start_matlab() failure with MATLAB R2022b and Python 3.10.9. Trace the call through matlab/engine/__init__.py, futureresult.py, and matlabfuture.py, then verify that the cause and a working resolution are documented or confirmed by a successful engine start.

Written by the indexing model from the issue text.

Description

Hello,

I installed matlab r2022b and python 3.10.9.

After installing python3 -m pip install matlabengine and import matlab.engine,
I failed to start matlab engine. After I enter eng = matlab.engine.start_matlab(), it takes a very long time to get the output:

>>> eng = matlab.engine.start_matlab()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/local/lib/python3.10/site-packages/matlab/engine/__init__.py", line 130, in start_matlab
    eng = future.result()
  File "/usr/local/lib/python3.10/site-packages/matlab/engine/futureresult.py", line 67, in result
    return self.__future.result(timeout)
  File "/usr/local/lib/python3.10/site-packages/matlab/engine/matlabfuture.py", line 87, in result
    handle = pythonengine.getMATLAB(self._future)
matlab.engine.EngineError: Connection to process with Exchange: " " was lost.

May I know if there is any solution to fix this?

Dominant language
Python
Stars
97
Forks
13
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from mathworks/matlab-engine-for-python

All issues in mathworks/matlab-engine-for-python

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.