Fail to start matlab engine in python 2022b
56 ビュー (過去 30 日間)
古いコメントを表示
I use MacBook Pro M1 chip with macOS13 and Python version is 3.9.13.
I installed the Matlab R2022b and followed the document to install engine API via pip with code :
python -m pip install matlabengine
However, when I call matlab engine, it is failed with the output
raise RuntimeError("Could not find directory: {0}".format(engine_dir))
RuntimeError: Could not find directory: /Applications/MATLAB_R2022b.app/extern/engines/python/dist/matlab/engine/maca64
I find the directory that I can only find maci64.
May I know how could I start matlab.engine in Python?
2 件のコメント
Praveen C
2022 年 12 月 2 日
Why does matlab make it so hard to use jupyter. It is as if they dont want us using matlab with jupyter.
回答 (7 件)
Charles King
2022 年 12 月 1 日
I think it is a M1 chip issue because I have the following directory: /Applications/MATLAB_R2022b.app/extern/engines/python/dist/matlab/engine/maci64
and
/Applications/MATLAB_R2022b.app/extern/engines/python/dist/matlab/engine/maca64
is what the script is looking for.
0 件のコメント
Kannan
2022 年 9 月 28 日
Could you check the default install location of MATLAB? This can be done by going into the MATLAB Command Window and calling :
matlabroot
By default, you will find MATLAB installed at the following location
/Applications/MATLAB_R2022b.app
When MATLAB is not installed in the default location, the bin/architecture directory within the MATLAB root directory must be added to an environment variable. The path can be added to the environment variable within the shell startup configuration file:
# in .bashrc
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:<matlabroot>/bin/glnxa64
Could you try these steps to see if the error still persists?
6 件のコメント
Hajar
2023 年 1 月 9 日
My MATLAB runtime root is at /usr/local/MATLAB_Runtime/R2022b on a GUI-less server Ubuntu 20.04 installation, so I checked
echo $LD_LIBRARY_PATH
And got nothing (it's not set) - am I required to install something else before R2022b to get this to work?
Then, I set the variable:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/MATLAB_Runtime/R2022b/glnxa64
Still got the following error with pip install:
RuntimeError: MATLAB R2022b installation not found. Install to default location, or add <matlabroot>/bin/glnxa64 to LD_LIBRARY_PATH, where <matlabroot> is the root of a MATLAB R2022b installation.
0 件のコメント
Gustavo Patow
2023 年 3 月 24 日
Hi,
I am having more or les sthe same problem with 2023a version. When I try:
python -m pip install .
in the correct folder, I get the error:
error: MATLAB installation in /Applications/MATLAB_R2023a.app/extern/engines/python/../../../bin is maci64, but Python interpreter is maca64. Reinstall MATLAB or use a different Python interpreter.
And when I do:
python -m pip install matlabengine
I get
RuntimeError: MATLAB R2022b installation not found. Install to default location, or add <matlabroot>/bin/maca64 to DYLD_LIBRARY_PATH, where <matlabroot> is the root of a MATLAB R2022b installation.
which shouldn't be because I am using 2023a, so no 2022b installation...
Any idea of how to solve this weird problem?
cheers
gus.-
4 件のコメント
Jyothi Karri
2023 年 4 月 19 日
Hi Gustav,
could you provide more details on which command you used to install the matlab engine using conda?
Gustavo Patow
2023 年 4 月 19 日
The problem was solved by getting back to Matlab 2022b. Thanks anyway!
Thuong
2023 年 11 月 6 日
I am having matlab 2023b, and have exactly problem, anyone solve it for macbook m1, and matlab 2023b?
Carlos Rondon
2024 年 1 月 15 日
Hi, I had the same problem. The issue is not related to matlab but to Anaconda's installation. In my case, I didn't have the latest version which is now compatible with Apple's M processors. Uninstalling conda and updating to the latest version solved all the issues.
Good Luck!
0 件のコメント
参考
カテゴリ
Help Center および File Exchange で Call MATLAB from Python についてさらに検索
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!