> ## Documentation Index
> Fetch the complete documentation index at: https://kb.hosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the Python Selector in cPanel

> Learn how to use the Python Selector to choose a Python version and create a virtual environment for that version.

This article describes how to use the Python Selector in cPanel to create a Python application that uses a specific Python version. Additionally, you can use a virtual environment to develop the application further.

## Using the Python Selector

To create a new Python application that uses a specific Python version, follow these steps:

1. Log in to cPanel.
   > 📘 Note
   >
   > If you do not know how to log in to your cPanel account, please see [this article](/docs/accessing-cpanel).

2. On the **Tools** page, in the **Software** section, click **Setup Python App**:\
   ![cPanel - Software - Setup Python App icon](https://static.hosting.com/kb/kb-cpanel-jupiter-software-setup-python-app-icon.png)

3. Click **CREATE APPLICATION**:\
   ![cPanel - Python Selector - Create Application button](https://static.hosting.com/kb/kb-cpanel-78-software-python-create-application.png)

   The application form appears:\
   ![cPanel - Python - Create application form](https://static.hosting.com/kb/kb-cpanel-78-software-python-create-application-form.png)

4. In the **Python version** list box, select the Python version you want to use.

5. In the **Application root** text box, type the directory where the application files are located.

6. In the **Application URL** list box, select the domain, and then type a URL for the application.

7. In the **Application startup file** text box, you can optionally specify the startup file for the application.

   > 📘 Note
   >
   > If you do not specify a startup file, cPanel creates a *passenger\_wsgi.py* startup file for you.

8. In the **Application Entry point** text box, you can optionally specify the callable object for the application.

   > 📘 Note
   >
   > If you do not specify the application entry point, cPanel creates a default **application** object for you.

9. In the **Passenger log file** text box, you can optionally specify a log file for the application.

   > 📘 Note
   >
   > * This option is only available on cPanel version 110 and earlier. For information about how to determine the cPanel version running on your account, please see [this article](/docs/cpanel-home-screen).
   >
   > * Logging is not supported on servers running LiteSpeed.

10. In the **Configuration files** section, you can manage and install modules for the application:

    * In the **Add another file and press enter** text box, type the name of the configuration file for your application and then press Enter. Typically, this file is named *requirements.txt*.
      > 👍 Tip
      >
      > For detailed information about the *requirements.txt* file format, please visit [https://pip.pypa.io/en/latest/reference/requirements-file-format/](https://pip.pypa.io/en/latest/reference/requirements-file-format/).

    * Click **Add**.

    * Click **Run Pip Install**, and then click the name of the configuration file you specified. The Python Selector installs the specified modules for the application.

11. Under **Environment variables**, you can optionally set environment variables for the application. To do this, click **ADD VARIABLE**, type the variable name and value, and then click **DONE**.

12. In the top right corner of the page, click **CREATE**:\
    ![cPanel - Python Selector - Create button](https://static.hosting.com/kb/kb-cpanel-78-software-python-create-button.png)

    cPanel creates the application and sets up the Python environment.

13. To work inside the newly created environment, connect to your account [using SSH](/docs/using-ssh-secure-shell), and then type the following command. Replace ***username***, ***application***, and ***version*** with the actual values as shown at the top of the page, next to **Enter to the virtual environment. To enter to virtual environment, run the command**:

    ```bash theme={null}
    source /home/username/virtualenv/application/version/bin/activate && cd /home/username/application
    ```

    You can now install modules or use other commands to develop the Python application further. Additionally, you can control the application's running state from cPanel:

    * To stop the application, click **STOP APP**.

    * To restart the application, click **RESTART**.

    * To completely remove the application from cPanel, click **DESTROY**.

## Related articles

* [Activating a Python virtual environment from a script file](/docs/activating-a-python-virtual-environment-from-a-script-file)

* [Connecting to MySQL using Python](/docs/connecting-to-mysql-using-python)

* [Python script basics](/docs/python-script-basics)
