{"id":3993,"date":"2024-05-07T09:53:32","date_gmt":"2024-05-07T04:23:32","guid":{"rendered":"https:\/\/shricloud.com\/kb\/?post_type=manual_kb&#038;p=3993"},"modified":"2024-11-29T10:43:42","modified_gmt":"2024-11-29T05:13:42","slug":"how-to-use-the-python-selector-in-control-panel","status":"publish","type":"manual_kb","link":"https:\/\/shricloud.com\/kb\/article\/how-to-use-the-python-selector-in-control-panel\/","title":{"rendered":"How to use the Python Selector in Control Panel"},"content":{"rendered":"\n<p>This article describes how to use the Python Selector in the Control Panel to create a Python application that uses a specific Python version. Additionally, you can use a virtual environment to develop the application further.Table of Contents<\/p>\n\n\n\n<ul id=\"toc\" class=\"wp-block-list\">\n<li><a href=\"https:\/\/shricloud.com\/kb\/article\/how-to-use-the-python-selector-in-control-panel\/\">Using the Python Selector<\/a><\/li>\n<\/ul>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"Using-the-Python-Selector\">Using the Python Selector<\/h4>\n\n\n\n<p>To create a new Python application that uses a specific&nbsp;Python version, follow these steps:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Log in to the Control Panel.<\/li>\n\n\n\n<li>Open the Python App tool under EXTRA FEATURES:<\/li>\n<\/ol>\n\n\n\n<figure class=\"wp-block-image size-large\"><img fetchpriority=\"high\" decoding=\"async\" width=\"1024\" height=\"762\" src=\"https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-093321-1-1024x762.jpg\" alt=\"\" class=\"wp-image-3995\" srcset=\"https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-093321-1-1024x762.jpg 1024w, https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-093321-1-300x223.jpg 300w, https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-093321-1-768x572.jpg 768w, https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-093321-1.jpg 1280w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>3.Click&nbsp;<strong>CREATE APPLICATION<\/strong>:<br><img decoding=\"async\" src=\"https:\/\/www.a2hosting.com\/images\/uploads\/knowledgebase_images\/kb-cpanel-78-software-python-create-application.png\" alt=\"cPanel - Python Selector - Create Application button\">The application form appears:<\/p>\n\n\n\n<figure class=\"wp-block-image size-large is-resized\"><img decoding=\"async\" width=\"1024\" height=\"583\" src=\"https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-094648-1024x583.png\" alt=\"\" class=\"wp-image-3996\" style=\"width:829px;height:auto\" srcset=\"https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-094648-1024x583.png 1024w, https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-094648-300x171.png 300w, https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-094648-768x437.png 768w, https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-094648-1536x875.png 1536w, https:\/\/shricloud.com\/kb\/wp-content\/uploads\/2024\/11\/Screenshot-2024-11-29-094648.png 1610w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n\n\n\n<p>4.In the&nbsp;<strong>Python version<\/strong>&nbsp;list box, select the&nbsp;Python version you want to use.<\/p>\n\n\n\n<p>5.In the&nbsp;<strong>Application root<\/strong>&nbsp;text box, type the&nbsp;directory where&nbsp;the application files are located.<\/p>\n\n\n\n<p>6.In the&nbsp;<strong>Application URL<\/strong>&nbsp;list box, select the domain, and then type a URL for the application.<\/p>\n\n\n\n<p>7.In the&nbsp;<strong>Application startup file<\/strong>&nbsp;text box,&nbsp;you can optionally specify the&nbsp;startup file for the application.<br>If you do not specify a startup file, control Panel creates a&nbsp;<em>passenger_wsgi.py<\/em>&nbsp;startup file for you.<\/p>\n\n\n\n<p>8.In the&nbsp;<strong>Application Entry point<\/strong>&nbsp;text box, you can optionally specify the callable object for the application.&nbsp;<br>If you do not specify the application entry point, the control panel will create a default&nbsp;<strong>application<\/strong>&nbsp;object for you.<\/p>\n\n\n\n<p>9.Under&nbsp;<strong>Environment variables<\/strong>, you can optionally set environment variables for the application. To do this, click&nbsp;<strong>ADD VARIABLE<\/strong>, type the variable name and value, and then click&nbsp;<strong>DONE<\/strong>.<\/p>\n\n\n\n<p>10.In the top right corner of the page, click\u00a0<strong>CREATE<\/strong>:<br><img decoding=\"async\" src=\"https:\/\/www.a2hosting.com\/images\/uploads\/knowledgebase_images\/kb-cpanel-78-software-python-create-button.png\" alt=\"cPanel - Python Selector - Create button\"> Direct admin control Panel creates the application and sets up the Python environment.<\/p>\n\n\n\n<p>11.To work inside the newly created environment, connect to your account&nbsp;using SSH, and then type the following command. Replace&nbsp;<em>username<\/em>,&nbsp;<em>application<\/em>, and&nbsp;<em>version<\/em>&nbsp;with the actual values as shown at the top of the page, next to&nbsp;<strong>Enter to the virtual environment. To enter to virtual environment, run the command<\/strong>:<br>Copysource \/home\/<em>username<\/em>\/virtualenv\/<em>application<\/em>\/<em>version<\/em>\/bin\/activate &amp;&amp; cd \/home\/<em>username<\/em>\/<em>application<\/em> You can now&nbsp;install modules or use other commands to develop the&nbsp;Python application further. Additionally, you can control the application&#8217;s running state from control Panel:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>To stop the application, click&nbsp;<strong>STOP APP<\/strong>.<\/li>\n\n\n\n<li>To restart the application, click&nbsp;<strong>RESTART<\/strong>.<\/li>\n\n\n\n<li>To completely remove the application from control Panel, click&nbsp;<strong>DESTROY<\/strong>.<\/li>\n<\/ul>\n","protected":false},"author":2,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"open","ping_status":"closed","template":"","format":"standard","manualknowledgebasecat":[8],"manual_kb_tag":[122,123,124],"class_list":["post-3993","manual_kb","type-manual_kb","status-publish","format-standard","hentry","manualknowledgebasecat-getting-started","manual_kb_tag-how-to-use-the-python-selector-in-control-panel","manual_kb_tag-python-selector-in-control-panel","manual_kb_tag-the-python-selector"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/shricloud.com\/kb\/wp-json\/wp\/v2\/manual_kb\/3993","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/shricloud.com\/kb\/wp-json\/wp\/v2\/manual_kb"}],"about":[{"href":"https:\/\/shricloud.com\/kb\/wp-json\/wp\/v2\/types\/manual_kb"}],"author":[{"embeddable":true,"href":"https:\/\/shricloud.com\/kb\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/shricloud.com\/kb\/wp-json\/wp\/v2\/comments?post=3993"}],"version-history":[{"count":9,"href":"https:\/\/shricloud.com\/kb\/wp-json\/wp\/v2\/manual_kb\/3993\/revisions"}],"predecessor-version":[{"id":4008,"href":"https:\/\/shricloud.com\/kb\/wp-json\/wp\/v2\/manual_kb\/3993\/revisions\/4008"}],"wp:attachment":[{"href":"https:\/\/shricloud.com\/kb\/wp-json\/wp\/v2\/media?parent=3993"}],"wp:term":[{"taxonomy":"manualknowledgebasecat","embeddable":true,"href":"https:\/\/shricloud.com\/kb\/wp-json\/wp\/v2\/manualknowledgebasecat?post=3993"},{"taxonomy":"manual_kb_tag","embeddable":true,"href":"https:\/\/shricloud.com\/kb\/wp-json\/wp\/v2\/manual_kb_tag?post=3993"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}