Python enviroment automatically loads when I run app designer application

3 次查看(过去 30 天)
I would like to run an application that uses Python but I need to specify the correct python enviroment. When I launch the application it automatically loads the previous python enviroment so I can't change it from start up callback. Moreover, even if I do not call any python scripts or modules inside my application, the python enviroments automatically loads. And it loads the previous python enviroment configured in the previous MATLAB session. I can only change the python enviroment restarting MATLAB and then launch a normal .m script. This issue is particularly frustrating because I would like to compile a standalone app and it won't work if I can't solve the issue. How can I solve this problem?
  3 个评论
Giovanni Pasini
Giovanni Pasini 2022-3-16
EDIT 2 I'll try to move these functions outside the main code of appdesigner and put them in a different .m script that will be called by the main app.
Giovanni Pasini
Giovanni Pasini 2022-3-16
EDIT 3 Moving the functions outside the main app code works. Python functions need to be called by an external .m file. In this case pyenv is not automatically activated and it is activated only at the start up when pyenv is called.

请先登录,再进行评论。

回答(0 个)

类别

Help CenterFile Exchange 中查找有关 Call Python from MATLAB 的更多信息

产品


版本

R2021b

Community Treasure Hunt

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

Start Hunting!

Translated by