# Using the Python Selector in cPanel

> Create a Python application in cPanel with the Python Selector, choose a Python version and install packages with pip.

Source: https://helpcenter.ruachost.com/cpanel/software/using-the-python-selector-in-cpanel/

The **Python Selector** in cPanel allows you to create and manage Python applications directly from your hosting account. It provides an easy way to select Python versions, configure virtual environments, and run applications without needing manual server setup.

## Why Use Python Selector?

- Run Python applications on shared hosting.
- Choose from multiple Python versions.
- Manage dependencies with `pip` inside a virtual environment.
- Simplify deployment without complex server configuration.

## Creating a Python Application

### 1. Access Python Selector

1. **Log in to cPanel.**
2. On the **Tools page → Software section**, click **Setup Python App**.

### 2. Create a New Application

1. Click **Create Application**.
2. Fill in the following fields:

   - **Python Version** → Select the version you want (e.g., 3.9, 3.11).
   - **Application Root** → Enter the directory where your app files are stored (e.g., `/home/username/myapp`).
   - **Application URL** → Define the domain or subdomain that will serve the app.
   - **Application Startup File** → Specify the entry point file (e.g., `app.py`).
3. Click **Create**.

### 3. Manage Dependencies

- After creating the app, you can install packages using **pip** inside the virtual environment.
- Example:

  ```
  pip install flask
  ```
- Use the **Run Pip Install** button in the Python Selector interface to install dependencies from your `requirements.txt` file.

### 4. Restart and Test

- Restart the application from the Python Selector dashboard after making changes.
- Visit the **Application URL** to confirm it runs correctly.
- Use **Error Logs** in cPanel to troubleshoot issues.

> **Note:**
- Always restart the app after modifying files or dependencies.
- Ensure your `requirements.txt` file is properly configured for easier dependency management.
- Python Selector creates a virtual environment for each application, isolating dependencies.
