Search

Settings > Languages > 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 will be set to the selected version.

    • Plus
      A click on this button opens a dialog box with a list of the additional Python versions available. By clicking on the “Install” button for the required Python version, it will be added to your development environment. After that, a restart of MAMP PRO is necessary.

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

    • Minus
      A click on this button will delete the selected Python version from your development environment. You will need to confirm this action beforehand.

      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 functionality. When this option is checked, the following is added to your “~/.profile” file. If a “.zprofile” file exists, the “.profile” file 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
      A click on this button opens an editor window in which you can edit the content of the standard Python file that is created for a host when Python is activated.
  • Directive <Directory> in httpd.conf

    • Default App configuration

      • Edit
        A click on this button opens an editor window in which you can edit the standard Python/wsgi configuration for the Apache web server. In this editor window, you will find a “Supported Placeholders” button at the bottom left. Click on this button 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

Additional Information