Running Python pymeshlab library from a deployed Matlab app crashes Python, while running the same thing within Matlab works fine
81 visualizaciones (últimos 30 días)
Mostrar comentarios más antiguos
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 comentarios
Saurabh
el 15 de Nov. de 2024 a las 5:49
Editada: Saurabh
el 15 de Nov. de 2024 a las 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:
Respuestas (0)
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!