- Configure Your System to Use Python
- Unable to resolve the name py.myfunc
- Versions of Python Compatible with MATLAB Products by Release
- Python virtual environments with MATLAB
Unable to run basic python commands despite building python with --enabled-shared on macOS Monterey
3 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
I've been building python locally to run with matlab. I have successfully built python in version 3.8.12, and 3.10.0 with the enabled-shared flag and created a virtual python enviroment using the venv package with the enviroment being called 'python-env'. I have sucessfully pointed to the right executable in matlab using the pyenv command and get the output shown below. But calling simple commands like py.open, or py.print("Hello") fail with the error line "Unable to resolve the name 'py.print'."
ans =
PythonEnvironment with properties:
Version: "3.8"
Executable: "/Users/adammurdock/Programming_Stuff/Reverb Project/python-env/bin/python"
Library: "/Users/adammurdock/.pyenv/versions/3.8.12/lib/libpython3.8.dylib"
Home: "/Users/adammurdock/Programming_Stuff/Reverb Project/python-env"
Status: NotLoaded
ExecutionMode: OutOfProcess
0 Commenti
Risposte (1)
Dinesh
il 5 Giu 2023
Modificato: Dinesh
il 5 Giu 2023
Hello Adam,
If you encounter the error message 'Unable to resolve the name py.myFuncName' in MATLAB, it may be caused by installation issues related to Python. One possible reason for this error is a compatibility issue between Python and MATLAB. Specifically, only Python 3.10 is compatible with MATLAB R2023a and R2022b.
To resolve this issue, I recommend that you review the following MATLAB documentation. This should provide you with the necessary information to troubleshoot and fix the error.
Hope this helps!
Thank you.
0 Commenti
Vedere anche
Categorie
Scopri di più su Call Python from MATLAB in Help Center e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!