How to run a matlab exe which contains python commands from another python code?
2 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
I have a Matlab code which calls some python modules. I made an exe from this Matlab code (let's call it pipeMe.exe) now I'm trying to run pipeMe.exe from another python code in another machine of course but apparently, it can't set the python version executable path from the second machine, thus it gives me this error:
Undefined variable "py" or class "py.sys.path".
Is there any way that I can set the pyversion executable from outside of Matlab while I run pipeMe.exe ? Or is there any possibility to set the pyversion executable path to a path that is accessible from both machines, and I just have to set it at the beginning of my pipeMe matlab code?
Thanks in advance for your help.
0 comentarios
Respuestas (1)
Yuanjie Su
el 20 de Sept. de 2019
[name,dir,index]=uigetfile({'*.exe'},'choose python.exe file');
if index==1
py_path=[dir name];
pyversion(py_path);
end
py_path is your python interpreter file path.(the file is called python.exe)
0 comentarios
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!