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?
Section titled “Why Use Python Selector?”- Run Python applications on shared hosting.
- Choose from multiple Python versions.
- Manage dependencies with
pipinside a virtual environment. - Simplify deployment without complex server configuration.
Creating a Python Application
Section titled “Creating a Python Application”1. Access Python Selector
Section titled “1. Access Python Selector”- Log in to cPanel.
- On the Tools page → Software section, click Setup Python App.
2. Create a New Application
Section titled “2. Create a New Application”-
Click Create Application.
-
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).
-
Click Create.
3. Manage Dependencies
Section titled “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.txtfile.
4. Restart and Test
Section titled “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.