matlabengine installation problem with the default install location of MATLAB

15 views (last 30 days)
Hi,
I am trying to install the MATLAB engine for Python on my computer and when I try
pip install matlabengine==9.14.3
I get the following ERROR:
ERROR: Could not build wheels for matlabengine, which is required to install pyproject.toml-based projects
With RuntimeError:
MATLAB R2023a installation not found. Install to default location, or add <matlabroot>/bin/maca64 to DYLD_LIBRARY_PATH, where <matlabroot> is the root of a MATLAB R2023a installation.
However, I have checked my installation location of MATLAB, which is:
So I really don't know which part is going wrong in my situation and how to fix it.
  1 Comment
Steven
Steven on 30 May 2023
I have tried to follow the official instruction but it's still not working. I believe the reason is maci64. It seems we can only use matlabengine on maca64.

Sign in to comment.

Answers (2)

Dinesh
Dinesh on 5 Jun 2023
Hi Steven!
It seems like the issue you're facing may be due to a version conflict between MATLAB and Python. To solve this, ensure that your Python version is between 3.8 and 3.10 since MATLAB R2023a supports the MATLAB engine for that range of Python versions only.
If the problem persists, try uninstalling the current packages and then install the MATLAB engine using the Python setup script. You can find information on how to download and install the MATLAB engine using the setup script in this MATLAB documentation.
It is also recommended to check the MATLAB documentation on version compatibility to ensure that everything is correctly set up.
  1. MATLAB version compatibility documentation
  2. Install MATLAB engine API (Application Programming Interface) using setup.py script.
  3. MATLAB Engine for Python 3.8 on MacBook Pro with M1 chip
I hope this helps!
Thank you.

Harsh
Harsh on 5 Sep 2025
I am trying to install MATLAB Engine in linux system,
i) Already downloaded MATLAB VERSION 2025a
ii) cd user/home/matlab_2025a_linux/extern/engines/python
iii) sudo python3 setup.py install
doing these steps matlabengine is already install with version 25.1 but system is unable to find out the MATLAB Library showing error like First issue: libmx.so: cannot open shared object file: No such file or directory
Second issue: libmx.so: cannot open shared object file: No such file or directory
for this i am adding enviroment variable export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/hred/matlab_2025a_Linux/bin/glnxa64. but showing same error as above mention

Community Treasure Hunt

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

Start Hunting!