About Munki's Embedded Python - munki/munki GitHub Wiki

About Munki's Embedded Python

[!NOTE] Munki 7 no longer includes a Python interpreter. See Python Removal for more information.

Munki 4 through Munki 6 embedded its own Python 3 framework and did not rely on Apple's /usr/bin/python installation, which was removed starting in macOS 12.3.

The included framework was created via this tool. The Python framework is based on a Python.org release, and adds PyObjC, xattr, and other needed modules to the installed Python modules.

The "embedded" Python framework was installed by default to /usr/local/munki/Python.framework.

The command-line tools had their "she-bang" line set to #!/usr/local/munki/munki-python.
/usr/local/munki/munki-python was a symlink to Python.framework/Versions/Current/bin/python3 in Munki releases prior to 6.5. In Munki 6.5, which updated the Python framework to version 3.12.2, the symlink pointed to Python.framework/Versions/Current/Resources/Python.app/Contents/MacOS/Python. This change avoided issues with Python 3.11 and above when the previous symlink was used.

This arrangement had a few implications.

If you have your own customized Python 3 you'd like Munki to use, you can replace the symlink at /usr/local/munki/munki-python with one pointing to your own Python. You could also decide then to not install Munki's embedded Python at all. Munki's embedded Python is a optional component package within the Munkitools distribution package.