Why is "mwpython" required to run Python packages on Mac OS?

I am using Compiler SDK to build a python library on Mac, so the program must be launched with the "mwpython" command instead of launching it with "python". Why do we have to wrap python commands like this on Mac machines?

 채택된 답변

MathWorks Support Team
MathWorks Support Team 2020년 8월 28일

0 개 추천

macOS does not allow to call graphics code from the main thread, "mwpython" is a way to get around this macOS limitation. Without this, it will not let you run such python packages generated by the MATLAB Compiler SDK.
"mwpython" is bash script located in "matlabroot/bin". This script is used for setting up all the necessary environment for MATLAB Compiler Runtime (MCR). Aside from setting up the environment for MCR, it will launch the default python for you (the default python is what will be launched in the current terminal by executing "python"), or the python version specified under PYTHONHOME.
You are welcome to open this bash script with any editor and read it.

추가 답변 (0개)

카테고리

도움말 센터File Exchange에서 Python Package Integration에 대해 자세히 알아보기

제품

릴리스

R2019b

태그

Community Treasure Hunt

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

Start Hunting!

Translated by