Cannot load python library with R2024a: API functions not available
I updated MATLAB to R2024a a few days ago, and I’m now trying the basic example to call Python from MATLAB here: https://ch.mathworks.com/help/matlab/call-python-libraries.html
I tried the following:
>> py.list
and see this error immediately:
Python API functions are not available.
I have the PythonEnvironment setup as follows:
>> pyversion(‘/Users/…/opt/anaconda3/bin/python’)
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Users/…/opt/anaconda3/bin/python"
Library: "/Users/…/opt/anaconda3/lib/libpython3.9.dylib"
Home: "/Users/…/opt/anaconda3"
Status: NotLoaded
ExecutionMode: OutOfProcess
It appears I cannot get the status to turn to "Loaded", which used to happen earlier with R2023b. I am also using the apple silicon native version (maca64) of MATLAB, which could also be a factor here. I read https://ch.mathworks.com/matlabcentral/answers/1977529-how-to-use-python-from-matlab-on-mac-with-apple-silicon and have installed Amazon Corretto 11 from here: https://ch.mathworks.com/support/requirements/apple-silicon.html
Any idea how I could get the Python API to load? Many thanks in advance for your help!I updated MATLAB to R2024a a few days ago, and I’m now trying the basic example to call Python from MATLAB here: https://ch.mathworks.com/help/matlab/call-python-libraries.html
I tried the following:
>> py.list
and see this error immediately:
Python API functions are not available.
I have the PythonEnvironment setup as follows:
>> pyversion(‘/Users/…/opt/anaconda3/bin/python’)
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Users/…/opt/anaconda3/bin/python"
Library: "/Users/…/opt/anaconda3/lib/libpython3.9.dylib"
Home: "/Users/…/opt/anaconda3"
Status: NotLoaded
ExecutionMode: OutOfProcess
It appears I cannot get the status to turn to "Loaded", which used to happen earlier with R2023b. I am also using the apple silicon native version (maca64) of MATLAB, which could also be a factor here. I read https://ch.mathworks.com/matlabcentral/answers/1977529-how-to-use-python-from-matlab-on-mac-with-apple-silicon and have installed Amazon Corretto 11 from here: https://ch.mathworks.com/support/requirements/apple-silicon.html
Any idea how I could get the Python API to load? Many thanks in advance for your help! I updated MATLAB to R2024a a few days ago, and I’m now trying the basic example to call Python from MATLAB here: https://ch.mathworks.com/help/matlab/call-python-libraries.html
I tried the following:
>> py.list
and see this error immediately:
Python API functions are not available.
I have the PythonEnvironment setup as follows:
>> pyversion(‘/Users/…/opt/anaconda3/bin/python’)
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.9"
Executable: "/Users/…/opt/anaconda3/bin/python"
Library: "/Users/…/opt/anaconda3/lib/libpython3.9.dylib"
Home: "/Users/…/opt/anaconda3"
Status: NotLoaded
ExecutionMode: OutOfProcess
It appears I cannot get the status to turn to "Loaded", which used to happen earlier with R2023b. I am also using the apple silicon native version (maca64) of MATLAB, which could also be a factor here. I read https://ch.mathworks.com/matlabcentral/answers/1977529-how-to-use-python-from-matlab-on-mac-with-apple-silicon and have installed Amazon Corretto 11 from here: https://ch.mathworks.com/support/requirements/apple-silicon.html
Any idea how I could get the Python API to load? Many thanks in advance for your help! python MATLAB Answers — New Questions