Error appears when importing matlab engine to python
2 views (last 30 days)
Show older comments
Hi there,
I am running a python script in which matlab engine is imported.
However, I got this error:
EnvironmentError: Please reinstall MATLAB Engine for Python or contact MathWorks Technical Support for assistance: /home/kewu/MATLAB/extern/engines/python/dist/matlab/engine/glnxa64/../../../../../../../bin/glnxa64/libssl.so.1.1: symbol EVP_idea_cbc version OPENSSL_1_1_0 not defined in file libcrypto.so.1.1 with link time reference.
Could you tell me how to fix it?
Thanks in advance,
Ke
3 Comments
Zvi Baratz
on 10 Feb 2020
Edited: Zvi Baratz
on 10 Feb 2020
It's far from ideal, but the solution I found was too move the import matlab.engine statement from the top of the imported module into a function or method within in.
To illustrate, instead of:
```
import matlab.engine
def run_matlab_analysis(*args, **kwargs) -> result:
engine = matlab.engine.start_matlab()
...
```
Simply use:
```
def run_matlab_analysis(*args, **kwargs) -> result:
import matlab.engine
engine = matlab.engine.start_matlab()
...
```
Now, the import statement will only be executed upon calling the function (and not upon being imported, which seems to be the problem).
Answers (0)
See Also
Categories
Find more on Call MATLAB from Python in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!