integrate pyton script in a standalone Matlab app

조회 수: 6 (최근 30일)
frederic tchuisseu
frederic tchuisseu 2021년 4월 29일
편집: James Nesson 2022년 4월 1일
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
Giancarlo Meccariello
Giancarlo Meccariello 2021년 7월 19일
@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 2022년 4월 1일
편집: James Nesson 2022년 4월 1일
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.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

Help CenterFile Exchange에서 Python Package Integration에 대해 자세히 알아보기

제품


릴리스

R2020b

Community Treasure Hunt

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

Start Hunting!

Translated by