Matlab Python Engine on MacOs

46 views (last 30 days)
dmhd on 20 Dec 2021
Edited: Walter Roberson on 19 Jun 2022
I am trying to install the Matlab Python API on a MacOS Monterey 12.0.1 machine.
After I performed the "python3 install" command, which executes correctly, the package is in the correct site-package folder. When I start a session with "python3" and try to "import matlab.engine", I get the following error message:
>>> import matlab.engine
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/opt/homebrew/lib/python3.9/site-packages/matlab/engine/", line 77, in <module>
raise EnvironmentError(secondExceptionMessage)
OSError: Please reinstall MATLAB Engine for Python or contact MathWorks Technical Support for assistance:
First issue: No module named 'matlabengineforpython3_9'
Second issue: dlopen(/Applications/, 0x0002): tried: '/Applications/' (mach-o file, but is an incompatible architecture (have 'x86_64', need 'arm64e')), '/usr/local/lib/' (no such file), '/usr/lib/' (no such file)
How can I solve this?
Thank you in advance!

Answers (1)

Anshika Chourasia
Anshika Chourasia on 25 Feb 2022
Edited: Anshika Chourasia on 25 Feb 2022
According to my understanding, to resolve this issue please install the maci64 version of Python and use that with (maci64) MATLAB.
You should download one of the "Intel-only" installers on this page ( to get "maci" versions of Python.

Sign in to comment.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!