How to install matlabengine (Windows 10, MATLAB R2020b, Python 3.8.10)

2.8k Views Asked by At

I have the following environment:

  • Windows 10
  • Python 3.8.10
  • MATLAB R2020b

I'm trying to install matlabengine (pip install matlabengine) package, and I'm getting the following error:

RuntimeError: No compatible MATLAB installation found in Windows Registry. This release of MATLAB Engine API for Python is compatible with version 9.13. The found versions were 9.9

  1. What am I missing ? (according to https://pypi.org/project/matlabengine/) it seems I'm using the right versions.
  2. How can I check the versions I have (9.9 or 9.13 because as I wrote above I have MATLAB R2020b and Python 3.8.10).
3

There are 3 best solutions below

1
zerg468 On

You can try to install specific version of matlabengine.

pip install matlabengine==9.13.1

If they cannot find your version, you might need to update pip.

Also, you can check your current matlabengine version.

pip show matlabengine

3
wovano On

The error is about the MATLAB version, not the version of matlabengine (the Python module).

You wrote that you have MATLAB 2020b. That is the release name for MATLAB version 9.9, as can be seen in this table on Wikipedia.

As can be read on the description of matlabengine 9.13.1, this engine version requires MATLAB release R2022b (= 9.13).

To use matlabengine with MATLAB 2020b, install version 9.9.1:

python -m pip install matlabengine==9.9.1
0
Tommy Wolfheart On

You will need to install the correct version. You can find a list of the releases on the MathWorks Github. However, you might still have a challenge picking the supported version for your system which is where I prefer the trial and error method below.

You need to try all versions of MATLAB engine starting from the latest one going backwards. To get a list of all the possible versions, try install one that doesn't exist e.g.

$ python -m pip install matlabengine==9.9.2

and it will give you an error with the list of possible versions.

What worked for me on Ubuntu was

$ python -m pip install matlabengine==9.12.17