0

I install matlab.engine on python3.7 (Ubuntu) as explained in the matlab site:

cd "matlabroot/extern/engines/python"
python setup.py install

But when I try to use in Pycharm as:

import matlab.engine
eng = matlab.start_matlab()
tf = eng.isprime(37)
print(tf)

Come the error "No module named 'matlab.engine'; 'matlab' is not a package" I have a lot of matlab function that are not so easy to translate to python. If I could just open then in python3.7 via Pycharm could be much mode easy.

1 Answers1

1

Please check if your version of MATLAB supports python 3.7.

Here is a link to a list for which python version is supported by which MATLAB version.

According to the document, for you to run the matlab engine in python 3.7 your version of MATLAB must be R2019a or higher

DvirH
  • 70
  • 8
  • Thanks. I find also Oc2py. Works well, bot it is very slow. Do you know if matlab.engine is very slow too? – Edilson Ferreira Jul 23 '20 at 15:55
  • That would depend on the way you use the matlab engine. I did not see your code but I'm guessing you might be fequently starting a new session. Starting a session (calling `matlab.engine.start_matlab()`) takes relatively a long time. @EdilsonFerreira – DvirH Jul 25 '20 at 18:17