Cannot execute Python code from Matlab
1 visualización (últimos 30 días)
Mostrar comentarios más antiguos
Alvaro
el 4 de Feb. de 2021
Comentada: Jose Olvera
el 28 de Ag. de 2021
Hello,
Currently I'm trying to call Python code from Matlab (using R2019b), nevertheless when I try amy python code I have the followin error:
>> P = py.sys.path
Unable to resolve the name py.sys.path.
>> py.print
Unable to resolve the name py.print.
Matlab cannot find or load any Python code, according to pyenv the instalation from Python is correct:
>> pyenv
ans =
PythonEnvironment with properties:
Version: "3.7"
Executable: "C:\Users\alis\AppData\Local\Programs\Python\Python37\python.exe"
Library: "C:\Users\alis\AppData\Local\Programs\Python\Python37\python37.dll"
Home: "C:\Users\alis\AppData\Local\Programs\Python\Python37"
Status: NotLoaded
ExecutionMode: InProcess
How can I load Python corretly to execute Python libraries and functions from Matlab?
2 comentarios
Mario Malic
el 4 de Feb. de 2021
It seems that Python is not loaded, I can't really tell how to do load it, maybe these functions are not correctly called. See this video for basics https://www.mathworks.com/videos/using-matlab-with-python-1591216182793.html
Respuesta aceptada
Alvaro
el 6 de Feb. de 2021
1 comentario
Jose Olvera
el 28 de Ag. de 2021
I have Python3.6 and 3.7 nstalled ...still have problem when using pyenv or pyversion()...fails to find them
Más respuestas (0)
Ver también
Categorías
Más información sobre Call Python from MATLAB en Help Center y File Exchange.
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!