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?

 采纳的回答

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