{"id":6299,"date":"2019-08-14T06:18:21","date_gmt":"2019-08-14T06:18:21","guid":{"rendered":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?p=6299"},"modified":"2022-02-19T09:40:23","modified_gmt":"2022-02-19T09:40:23","slug":"learn-how-to-configure-and-use-a-newer-version-of-python","status":"publish","type":"post","link":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/","title":{"rendered":"Learn how to configure and use a newer version of Python"},"content":{"rendered":"<p>This article guides you on how you can configure and use a new version of Python. You may need to do it when :<br \/>\n\u2022 You have a managed server account and you want to use new Python version than what is already installed on the server.<\/p>\n<p><strong>Note:<\/strong> This applies to all hosting accounts that have cPanel, including shared and reseller server.<\/p>\n<p>\u2022 You have an unmanaged server account, and the package repositories for your Linux distribution contain an older version of Python.<\/p>\n<p>Before proceeding with this article make sure that you have a compiler and other development tools installed on your server.<\/p>\n<p>Let&#8217;s get started.<\/p>\n<h2># Steps to configure managed servers<\/h2>\n<p>Your account can be located on a managed server that already has an older version of Python installed. So, if you wish to run a new version of Python, you can compile it by using this source code.<br \/>\nPerform the following steps to compile Python from the source code :<\/p>\n<p>1. Using SSH, log in to your account.<\/p>\n<p>2. Type following command in the command prompt :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">cd~\nwget https:\/\/www.python.org\/ftp\/python\/3. 5. 2\/Python-3. 5. 2. tgz\ntar xvzf Python-3. 5. 2. tgz\ncd Python-3. 5. 2\n.\/configure --prefix=$HOME\nmake\nmake install<\/pre>\n<p><strong>Note:<\/strong> This command explains how to install Python version 3.5.2. If you want to install a different version, then visit https:\/\/www.python.org\/ftp\/python\/ to view the other versions that are available for download. Once you select a version, run the previous commands with the version number that you have selected at the place of 3.5.2.<\/p>\n<p>3. To configure your shell environment and to use the new compiled executable, type the following command.<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">echo 'alias python3=\"\/home\/username\/bin\/python3.5\" '&gt;&gt; ~\/.bashrc\nsource ~\/.bashrc<\/pre>\n<p>Replace the username with your MilesWeb hosting account username.<\/p>\n<p>4. In order to confirm that your account is configured to use the new version, type the following command :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">python --version<\/pre>\n<h2># Steps to install virtualenv<\/h2>\n<p>To create virtual environments by using your installed version of Python, you first need to install the virtualenv program. Type following command to do this :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">cd ~\/bin\n\npython3.5 -m pip install virtualenv<\/pre>\n<p>You are then allowed to create a virtual environment by running the virtualenv program in the bin directory. For example: if you want to create a virtual environment named testenv, type the following command :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">~\/bin\/virtualenv testenv<\/pre>\n<p>Type the following command, to activate the new environment.<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">source testenv\/bin\/activate<\/pre>\n<h2>#Steps to configure unmanaged servers<\/h2>\n<p>There is a possibility that the package repositories for your Linux distribution may contain the older version of the Python. But, if you want to run the new version of Python, then you can compile it from the source code. Perform the following steps to do so:<\/p>\n<p>1. Using SSH, log in to your account.<\/p>\n<p>2. Type the following command in the prompt, as a root user:<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">cd~\nwget https:\/\/www.python.org\/ftp\/python\/3. 5. 2. Python-3. 5. 2. tgz\n\ntar xvzf Python-3. 5. 2. tgz\n\ncd Python-3. 5. 2\n\n.\/configure\n\nmake\n\nmake install<\/pre>\n<p>3. In order to configure the shell environment and to use the new compiled executable, type the following command :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">echo 'alias python3=\"\/executable_path\/python3.5\" ' &gt;&gt; ~\/.bashrc\nsource ~\/ .bashrc<\/pre>\n<p>Replace executable_path with the path to the compiled Python executable (example, \/usr\/local\/bin).<\/p>\n<p>4. To confirm if your account is configured to use the new version, type the following command :<\/p>\n<pre class=\"trim-whitespace:false lang:default decode:true \">python --version<\/pre>\n<p>For more information about Python, visit <a href=\"https:\/\/www.python.org\" target=\"_blank\" rel=\"nofollow noopener\">https:\/\/www.python.org<\/a><\/p>\n<p><strong>Also Read :<\/strong><\/p>\n<p><strong>1)<a href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/create-the-end-user-access-python-and-ruby-selector\/\">How to Create the End User Access for Python and Ruby Selector?<\/a><\/strong><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This article guides you on how you can configure and use a new version of Python. You may need to do it when : \u2022 You have a managed server account and you want to use new Python version than what is already installed on the server. Note: This applies to all hosting accounts that [&hellip;]<\/p>\n","protected":false},"author":18,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[931,932],"class_list":["post-6299","post","type-post","status-publish","format-standard","placeholder-for-hentry","category-web-hosting-faq","tag-python","tag-python-version"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v25.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Learn how to configure and use a newer version of Python - Web Hosting FAQs by MilesWeb<\/title>\n<meta name=\"description\" content=\"The article explains you how to configure and use a newer version of Python.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/\" \/>\n<meta property=\"og:locale\" content=\"en_GB\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Learn how to configure and use a newer version of Python - Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"og:description\" content=\"The article explains you how to configure and use a newer version of Python.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/\" \/>\n<meta property=\"og:site_name\" content=\"Web Hosting FAQs by MilesWeb\" \/>\n<meta property=\"article:published_time\" content=\"2019-08-14T06:18:21+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2022-02-19T09:40:23+00:00\" \/>\n<meta name=\"author\" content=\"Sonam Wagh\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Sonam Wagh\" \/>\n\t<meta name=\"twitter:label2\" content=\"Estimated reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/\",\"name\":\"Learn how to configure and use a newer version of Python - Web Hosting FAQs by MilesWeb\",\"isPartOf\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\"},\"datePublished\":\"2019-08-14T06:18:21+00:00\",\"dateModified\":\"2022-02-19T09:40:23+00:00\",\"author\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\"},\"description\":\"The article explains you how to configure and use a newer version of Python.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/#breadcrumb\"},\"inLanguage\":\"en-GB\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Learn how to configure and use a newer version of Python\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/\",\"name\":\"Web Hosting FAQs by MilesWeb\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-GB\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4\",\"name\":\"Sonam Wagh\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-GB\",\"@id\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g\",\"caption\":\"Sonam Wagh\"},\"description\":\"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.\",\"url\":\"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/sonam\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Learn how to configure and use a newer version of Python - Web Hosting FAQs by MilesWeb","description":"The article explains you how to configure and use a newer version of Python.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/","og_locale":"en_GB","og_type":"article","og_title":"Learn how to configure and use a newer version of Python - Web Hosting FAQs by MilesWeb","og_description":"The article explains you how to configure and use a newer version of Python.","og_url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/","og_site_name":"Web Hosting FAQs by MilesWeb","article_published_time":"2019-08-14T06:18:21+00:00","article_modified_time":"2022-02-19T09:40:23+00:00","author":"Sonam Wagh","twitter_misc":{"Written by":"Sonam Wagh","Estimated reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/","name":"Learn how to configure and use a newer version of Python - Web Hosting FAQs by MilesWeb","isPartOf":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website"},"datePublished":"2019-08-14T06:18:21+00:00","dateModified":"2022-02-19T09:40:23+00:00","author":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4"},"description":"The article explains you how to configure and use a newer version of Python.","breadcrumb":{"@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/#breadcrumb"},"inLanguage":"en-GB","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/learn-how-to-configure-and-use-a-newer-version-of-python\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/"},{"@type":"ListItem","position":2,"name":"Learn how to configure and use a newer version of Python"}]},{"@type":"WebSite","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#website","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/","name":"Web Hosting FAQs by MilesWeb","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-GB"},{"@type":"Person","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/dc645d02823c86e07e53798ebe02c6f4","name":"Sonam Wagh","image":{"@type":"ImageObject","inLanguage":"en-GB","@id":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/9cb2cf6ae11d7625ef6417ef8e84ba25?s=96&d=blank&r=g","caption":"Sonam Wagh"},"description":"With an interest in doing something creative daily, Sonam works as a Digital Marketing Executive. She likes to write technical blogs related to web hosting, digital marketing, and other IT topics. She also likes to spend her leisure time on social media to find different strategies for client engagement.","url":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/author\/sonam\/"}]}},"views":515,"_links":{"self":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/6299","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/users\/18"}],"replies":[{"embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/comments?post=6299"}],"version-history":[{"count":2,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/6299\/revisions"}],"predecessor-version":[{"id":13819,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/posts\/6299\/revisions\/13819"}],"wp:attachment":[{"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/media?parent=6299"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/categories?post=6299"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.milesweb.co.uk\/hosting-faqs\/wp-json\/wp\/v2\/tags?post=6299"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}