2

I have a Linux OS and I want to install MATLAB Engine API for Python to use MATLAB on the Jupiter notebook. I am following the steps of installation from here but it seems that the Matlab engine API only is not working with Python 3.7 (but it is capable with python 3.6) my final goal is to use Matlab using imatlab package in Jupiter notebook. Is there anyone who ever been able to install MATLAB Engine API for Python with Python 3.7?

thank you for your time.

1 Answers1

2
  • Before installing matlab_engin you may just change setup.py file. (you should change the permission of this file, for example: chmod 777 setup.py). Add '3.7' in list of supported version:
_supported_versions = ['2.7', '3.4', '3.5', '3.6', '3.7']
  • Install in shell
python3.7 setup.py install
  • Matlab kernel also should be install.
pip install matlab_kernel
  • Then in file /usr/local/lib/python3.7/site-packages/matlab/engine/__init__.py commentraise EnvironmentError("Python %s is not supported." % _version) and add _PYTHONVERSION = 3_6. In result:
if _version in _supported_versions:
    _PYTHONVERSION = _version
else:
    _PYTHONVERSION = '3_6'
    #raise EnvironmentError("Python %s is not supported." % _version)

Now you can start jupyter and choose Matlab kernel

kephircheek
  • 71
  • 2
  • 4
  • running the `python -mimatlab install` to install matlab kernel spec. returns this error: `ModuleNotFoundError: No module named 'matlabengineforpython3_7'` I should mention that I changed the `_supported_versions = ['2_7', '3_5', '3_6', '3_7']` too. – Alireza Ghavaminia May 15 '19 at 16:15