Knowledge Base

Using the Python Selector to choose a Python version

This article describes how to use the Python Selector in cPanel to select a Python version for use with an application, use a virtual environment for that version and use Passenger to publish the application to the web.

To choose a Python version and set up the application follow these steps:

  1. Log in to cPanel.
    If you do not know how to log in to your cPanel account, please see this article.
  2. In the SOFTWARE section of the cPanel home screen, click Setup Python App.
  3. Under Setup new application, create a new application:
    Setup Python App dialog box
  4. In the Python version list box, select the required Python version.
  5. In the App Directory text box, type a directory name for the application.
  6. In the App Domain/URI list box, select the domain, and then type a URL for the application.
  7. Click Setup. cPanel creates the application and sets up the Python environment.
    Applicaton settings dialog box
  8. To work inside the newly created environment, connect to your account using SSH, and then type the following command. Enter the command as shown below, replacing username, application, and version with the actual values as shown next to Command for entering to virtual environment in the Python Selector.
    source /home/username/virtualenv/application/version/bin/activate
    
  9. It is now possible to install modules or use other commands to develop the new Python application.