Skip to content
MAMP PRO Documentation

Python

Python is a widely used high-level, general-purpose, interpreted, dynamic programming language. MAMP PRO installs Python in your /Applications/MAMP/Library/bin/python directory. MAMP PRO does not make any changes to the Python build that is pre-installed on your Mac. The Python build provided by Apple is installed in /usr/bin/python.

MAMP PRO - Settings - Languages - Python


  • Default version
    When creating a new site, its Python version is set to the selected version.

    • Plus
      Click this button to open a dialog listing additional Python versions. Click the “Install” button next to the required version to add it to your environment. Afterwards, MAMP PRO must be restarted.

      MAMP PRO - Settings - Languages - Python - Add additional Python version

    • Minus
      Click this button to remove the selected Python version from your environment. You will be asked to confirm before it is deleted.

      MAMP PRO - Settings - Languages - Python - Remove Python version

    • Activate command line shortcuts for the selected Python version
      Enable this option to make the current Python version available on the command line. MAMP PRO uses an alias to provide this. When this option is enabled, the following is added to your ~/.profile file. If a “.zprofile” file exists, the “.profile” content will be added to it.

      alias python='/Applications/MAMP/Library/bin/python'

      Confirm your Python is enabled by typing python -V in a new Terminal window.

      MAMP PRO - Settings - Languages - Python - Command line


  • Default App index.py File

    • Edit
      Click this button to open an editor window where you can edit the default Python file that is created for a site when Python is enabled.
  • Directive <Directory> in httpd.conf

    • Default App configuration

      • Edit
        Click this button to open an editor window where you can edit the default Python/wsgi configuration for the Apache web server. In this window, there is a “Supported Placeholders” button at the bottom left. Click it to display the supported placeholders.

        Supported placeholders are:

        • MAMP_PythonAppName_MAMP
        • MAMP_PythonProcessGroup_MAMP
        • MAMP_PythonAppAlias_MAMP
        • MAMP_PythonIndexPyPath_MAMP
        • MAMP_VirtualHost_DocumentRoot_MAMP
        • MAMP_VirtualHost_IP_MAMP
        • MAMP_VirtualHost_Port_MAMP