integrate pyton script in a standalone Matlab app

6 visualizaciones (últimos 30 días)
frederic tchuisseu
frederic tchuisseu el 29 de Abr. de 2021
Editada: James Nesson el 1 de Abr. de 2022
i'm trying to develop a standalone matlab app but with some python script in it. when i run the code in app designer, it works fine but when i compile the standalone app, it doesn't work. when packaging I include the python script and the python folder (oct_converter) which it's necessary and also the init.py and the package looks fine I guess. I also commented the lines where I called python and develop another standalone app and it worked so I think it's definitely the use of python script. also since it's the standalone app, it doesn't show me any erorr message it just crashes
I'm running matlab R2020b on macOS
  6 comentarios
Giancarlo Meccariello
Giancarlo Meccariello el 19 de Jul. de 2021
@frederic tchuisseu Yes the startup program of the app designer. That runs everytime you launch the app, therefore you make sure that python is always found.
@Eric Delgado I downloaded Anaconda on my computer and installed it for "all users". With the command
pe = pyenv
the python version is found, and it works only if Anaconda was installed for all users.
I didn't include any separate python scripts as you did but I used some python functions instead.
When you export your standalone programm, make sure the end user has installed Anaconda aswell for "all users" on their computer. With the startup programm searching for the actual python version should everthing work as desired.
Let me know if this helped you.
James Nesson
James Nesson el 1 de Abr. de 2022
Editada: James Nesson el 1 de Abr. de 2022
i have this in the startup call back and it runs with no alert.
%check if python is installed
pe = pyenv;
if isempty(pe.Version)
fig = uifigure;
uialert(fig,'Please install Python and XlsxWriter',['Python' ...
' is not installed']);
end
but when my code gets to my pyrunfile command it does not work.

Iniciar sesión para comentar.

Respuestas (0)

Categorías

Más información sobre Python Package Integration en Help Center y File Exchange.

Productos


Versión

R2020b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by