How do I troubleshoot a MATLAB crash when trying to use the Python Interface?

244 vues (au cours des 30 derniers jours)
Whenever I try to use some Python functions in MATLAB using the Python Interface, my MATLAB crashes. What can I do to avoid such a crash?
 

Réponse acceptée

MathWorks Support Team
MathWorks Support Team le 7 Août 2024
Modifié(e) : MathWorks Support Team le 7 Août 2024
If MATLAB crashes when you try to use the Python Interface for MATLAB, then this might be caused by a version conflict between libraries shipped by MATLAB and the ones required by the Python package you are trying to use. More recent MATLAB releases are expected to have fewer such conflicts, so first try upgrading to a newer release, if possible.
Starting in MATLAB R2019b, you can also try the out-of-process execution mode while working with the Python interface in MATLAB. This runs the Python commands in a separate process and helps avoid potential library conflicts. You can use the following command to specify out-of-process execution mode.
pyenv("ExecutionMode","OutOfProcess")
Please refer to the documentation link below to learn more about this.
https://www.mathworks.com/help/matlab/matlab_external/out-of-process-execution-of-python-functionality.html

Plus de réponses (0)

Catégories

En savoir plus sur Call Python from MATLAB dans Help Center et File Exchange

Produits


Version

R2019b

Community Treasure Hunt

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

Start Hunting!

Translated by