Running Python pymeshlab library from a deployed Matlab app crashes Python, while running the same thing within Matlab works fine
조회 수: 81 (최근 30일)
이전 댓글 표시
I am trying to call Python scripts with a Pymeshlab library (https://github.com/cnr-isti-vclab/PyMeshLab) using 'pyrunfile' from Matlab app (developed in Matlab App Designer).
First, I was using the In-process execution mode. At a certain constellation, this is causing Matlab to crash with the following error: 'QT platform plugin could not be initialized'. The crash occurs both when the app is run from Matlab and when it is deployed.
Second, I tried switching to Out-of-process execution mode. When running the app from Matlab, the scripts works without any errors, but once I try running it from the deployed app, it leads to Python process termination:
'Python process terminated unexpectedly. To restart the Python interpreter, first call "terminate(pyenv)" and then call a Python function.'
The issue is probably specific to scripts that are using the Pymeshlab library (and probably only specific functions from within the library), as running scripts using only Numpy works without any issues.
I am using Python 3.10 and Matlab 2024a, but I tried also Python 3.11, 2024b, combined with different versions of the library and nothing seemed to help. I am using Windows 11.
If anyone has any idea about what to do with it, or insight into why it works when the app is run from Matlab but not when it is deployed, I'd be very grateful!
댓글 수: 2
Saurabh
2024년 11월 15일 5:49
편집: Saurabh
2024년 11월 15일 5:51
I faced this issue in the past and couldn't resolve it. To avoid the Python-related problems you're experiencing, try using "actxserver" to connect MATLAB directly with the backend COM object and see if that resolves the issue.
To know how the "actxserver" works, refer to the following documentaion:
답변 (0개)
참고 항목
카테고리
Help Center 및 File Exchange에서 Call Python from MATLAB에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!