{"id":1840,"date":"2023-07-30T12:30:00","date_gmt":"2023-07-30T17:30:00","guid":{"rendered":"https:\/\/linuxhostsupport.com\/blog\/?p=1840"},"modified":"2023-08-29T03:33:30","modified_gmt":"2023-08-29T08:33:30","slug":"how-to-install-and-switch-python-versions-on-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/","title":{"rendered":"How to Install and Switch Python Versions on Ubuntu 22.04"},"content":{"rendered":"\n<div id=\"linux-1388459873\" class=\"linux-before-1st-paragraph linux-entity-placement\" style=\"margin-top: 15px;margin-bottom: 15px;\"><a href=\"https:\/\/www.rosehosting.com\/managed-vps-hosting\/?mtm_campaign=blogs&#038;mtm_source=lhs&#038;mtm_medium=blog&#038;mtm_content=managed-vps&#038;mtm_cid=1339&#038;mtm_placement=inline\" aria-label=\"Untitled\"><img src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322.jpg\" alt=\"\"  srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322.jpg 728w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340090_NVMeGoogleAds_728x90_041322-300x37.jpg 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" width=\"728\" height=\"90\"  style=\"display: inline-block;\" \/><\/a><\/div><p>In this tutorial, we are going to explain in step-by-step detail how to install multiple Python versions on Ubuntu 22.04<\/p>\n\n\n\n<p>Python is a high-level, general-purpose programming language compatible with different operating systems such as MacOS, Windows, Linux and etc. <\/p>\n\n\n\n<!--more-->\n\n\n\n<p>In this blog post, we will focus on installing Python in the Linux distributions. Also, sometimes on one <a href=\"https:\/\/linuxhostsupport.com\/\" title=\"\">Linux server<\/a>, it is necessary to be installed multiple Python versions. This tutorial will teach you about installation and changing between different versions.<\/p>\n\n\n\n<p>Installing multiple Python versions on Ubuntu 22.04 is a very easy and straightforward process that may take up to 15 minutes. Let&#8217;s get things done!<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Prerequisites<\/h2>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Fresh install of Ubuntu 20.04<\/li>\n\n\n\n<li>User privileges: root or non-root user with sudo privileges<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">Update the System<\/h2>\n\n\n\n<p>Every fresh installation of the operating system needs the packages to be updated to the latest versions available.<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt update -y &amp;&amp; sudo apt upgrade -y<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 1. Install Python 3.10<\/h2>\n\n\n\n<p>We will start with the latest version available in the default repository of Ubuntu 22.04. To install <strong>python3.10<\/strong> execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install python3.10 -y<\/pre>\n\n\n\n<p>To check the installed version, execute the command <strong>python3.10 -V<\/strong>. You should receive the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# python3.10 -V\nPython 3.10.6\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 2. Install Python 3.8<\/h2>\n\n\n\n<p>The second Python version on our list will be Python 3.8. To install it, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install python3.8 -y<\/pre>\n\n\n\n<p>To check the installed version, execute the command <strong>python3.8 -V<\/strong>. You should receive the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# python3.8 -V\nPython 3.8.16\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 3. Install Python 3.6<\/h2>\n\n\n\n<p>The third Python version will be the Python 3.6 version. Let&#8217;s execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt install python3.6 -y<\/pre>\n\n\n\n<p>As you noticed, the installation process failed with the following message:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:~# sudo apt install python3.6 -y\nReading package lists... Done\nBuilding dependency tree... Done\nReading state information... Done\nE: Unable to locate package python3.6\nE: Couldn't find any package by glob 'python3.6'<\/pre>\n\n\n\n<p>This means that Python3.6 is not in the default repository of Ubuntu 22.04. We will need to download the build from the source. To do that, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/opt\n\nwget https:\/\/www.python.org\/ftp\/python\/3.6.9\/Python-3.6.9.tgz\n\ntar xfv Python-3.6.9.tgz\n\ncd \/Python-3.6.9\n<\/pre>\n\n\n\n<p>Before we proceed with installation, we need to install the prerequisites for the older Python versions:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo apt-get install -y make build-essential libssl-dev zlib1g-dev libbz2-dev libreadline-dev libsqlite3-dev wget curl llvm libncurses5-dev libncursesw5-dev xz-utils tk-dev libffi-dev liblzma-dev libgdbm-dev libnss3-dev libedit-dev libc6-dev<\/pre>\n\n\n\n<p>After all these preparations, we can finally build and install it with the following commands:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">.\/configure --enable-optimizations\n\nsudo make altinstall\n<\/pre>\n\n\n\n<p>To check the installed version, execute the command <strong>python3.6 -V<\/strong>. You should receive the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:\/opt\/Python-3.6.9# python3.6 -V\nPython 3.6.9\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 4. Install Python 3.5<\/h2>\n\n\n\n<p>The last version of Python in this blog post will be the Python3.5 version. We will download and install the same way as the Python3.6<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">cd \/opt\n\nwget https:\/\/www.python.org\/ftp\/python\/3.5.10\/Python-3.5.10.tgz\n\ntar xfv Python-3.5.10.tgz\n\ncd Python-3.5.10\/\n\n.\/configure --enable-optimizations\n\nsudo make altinstall\n<\/pre>\n\n\n\n<p>To check the installed version, execute the command <strong>python3.5 -V<\/strong>. You should receive the following output:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:\/opt\/Python-3.5.10# python3.5 -V\nPython 3.5.10\n<\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Step 5. Switch between Python versions<\/h2>\n\n\n\n<p>In the last step of this tutorial, we are going to explain how you can switch between different Python versions. First, you need to know that the newer Python versions installed from the default repository are located in the <strong>\/usr\/bin<\/strong> directory on the server, while the older versions built from the source are located in <strong>\/usr\/local\/bin<\/strong> directory.<\/p>\n\n\n\n<p>We need to create symbolic links for every installed Python version, including the path of the installed Python version. Execute the following commands one by one:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo update-alternatives --install \/usr\/bin\/python python \/usr\/bin\/python3.10 1\nsudo update-alternatives --install \/usr\/bin\/python python \/usr\/bin\/python3.8 2\nsudo update-alternatives --install \/usr\/local\/bin\/python python \/usr\/local\/bin\/python3.6 3\nsudo update-alternatives --install \/usr\/local\/bin\/python python \/usr\/local\/bin\/python3.5 4\n<\/pre>\n\n\n\n<p>Your command line should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:\/# sudo update-alternatives --install \/usr\/bin\/python python \/usr\/bin\/python3.10 1\nupdate-alternatives: using \/usr\/bin\/python3.10 to provide \/usr\/bin\/python (python) in auto mode\nroot@host:\/opt\/Python-3.6.9# sudo update-alternatives --install \/usr\/bin\/python python \/usr\/bin\/python3.8 2\nupdate-alternatives: using \/usr\/bin\/python3.8 to provide \/usr\/bin\/python (python) in auto mode\nroot@host:\/opt\/Python-3.6.9# sudo update-alternatives --install \/usr\/local\/bin\/python python \/usr\/local\/bin\/python3.6 3\nupdate-alternatives: renaming python link from \/usr\/bin\/python to \/usr\/local\/bin\/python\nupdate-alternatives: using \/usr\/local\/bin\/python3.6 to provide \/usr\/local\/bin\/python (python) in auto mode\nroot@host:\/opt\/Python-3.6.9# sudo update-alternatives --install \/usr\/local\/bin\/python python \/usr\/local\/bin\/python3.5 4\nupdate-alternatives: using \/usr\/local\/bin\/python3.5 to provide \/usr\/local\/bin\/python (python) in auto mode<\/pre>\n\n\n\n<p>To list and choose which Python version should be active, execute the following command:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">sudo update-alternatives --config python<\/pre>\n\n\n\n<p>The output should look like this:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:\/# sudo update-alternatives --config python\nThere are 4 choices for the alternative python (providing \/usr\/local\/bin\/python).\n\n  Selection    Path                      Priority   Status\n------------------------------------------------------------\n<strong>* 0            \/usr\/local\/bin\/python3.5   4         auto mode<\/strong>\n  1            \/usr\/bin\/python3.10        1         manual mode\n  2            \/usr\/bin\/python3.8         2         manual mode\n  3            \/usr\/local\/bin\/python3.5   4         manual mode\n  4            \/usr\/local\/bin\/python3.6   3         manual mode<\/pre>\n\n\n\n<p>You can enter any number and use that Python version. For example, we choose the Python3.10 by entering the number 1<\/p>\n\n\n\n<p>Execute the command <strong>sudo update-alternatives &#8211;config python<\/strong> again, and you will notice the changed version:<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">root@host:\/# sudo update-alternatives --config python\nThere are 4 choices for the alternative python (providing \/usr\/local\/bin\/python).\n\n  Selection    Path                      Priority   Status\n------------------------------------------------------------\n  0            \/usr\/local\/bin\/python3.5   4         auto mode\n<strong>* 1            \/usr\/bin\/python3.10        1         manual mode<\/strong>\n  2            \/usr\/bin\/python3.8         2         manual mode\n  3            \/usr\/local\/bin\/python3.5   4         manual mode\n  4            \/usr\/local\/bin\/python3.6   3         manual mode<\/pre>\n\n\n\n<p>Congratulations! You successfully installed multiple <a href=\"https:\/\/www.python.org\/\" title=\"\">Python versions<\/a> on your system and learned how to switch them. Of course, you do not have to do this by yourself. You can contact our technical support, and the admins will help you with any aspect of the installation and configuration of Python versions. We are available 24\/7.<\/p>\n\n\n\n<p>If you liked this post on how to Install and Switch Python Versions in Ubuntu 22.04, please share it with your friends on social networks or simply leave a reply below. Thanks.<\/p><div id=\"linux-2912678682\" class=\"linux-after-8th-paragraph linux-entity-placement\" style=\"margin-top: 15px;margin-bottom: 15px;\"><a href=\"https:\/\/www.rosehosting.com\/managed-vps-hosting\/?mtm_campaign=blogs&#038;mtm_source=lhs&#038;mtm_medium=blog&#038;mtm_content=managed-vps&#038;mtm_cid=1340&#038;mtm_placement=inline\" aria-label=\"Untitled\"><img src=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622.jpg\" alt=\"\"  srcset=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622.jpg 728w, https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2020\/12\/1340095_VPSGoogleAds_728x90_042622-300x37.jpg 300w\" sizes=\"(max-width: 728px) 100vw, 728px\" width=\"728\" height=\"90\"  style=\"display: inline-block;\" \/><\/a><\/div>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial, we are going to explain in step-by-step detail how to install multiple Python versions on Ubuntu 22.04 Python is a high-level, general-purpose programming language compatible with different operating systems such as MacOS, Windows, Linux and etc.<\/p>\n","protected":false},"author":1,"featured_media":1896,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[250,2,182],"tags":[251,20],"class_list":["post-1840","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","category-tutorials","category-ubuntu","tag-python-versions","tag-ubuntu"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.4 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install and Switch Python Versions on Ubuntu 22.04 | LinuxHostSupport<\/title>\n<meta name=\"description\" content=\"Installing and switching Python versions on Ubuntu 22.04 will be a breeze with our help. Read our guide to find out more. Let&#039;s get things going!\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to Install and Switch Python Versions on Ubuntu 22.04 | LinuxHostSupport\" \/>\n<meta property=\"og:description\" content=\"Installing and switching Python versions on Ubuntu 22.04 will be a breeze with our help. Read our guide to find out more. Let&#039;s get things going!\" \/>\n<meta property=\"og:url\" content=\"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/\" \/>\n<meta property=\"og:site_name\" content=\"LinuxHostSupport\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/linuxhostsupport\" \/>\n<meta property=\"article:published_time\" content=\"2023-07-30T17:30:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2023-08-29T08:33:30+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/07\/how-to-install-and-switch-python-versions-on-ubuntu-22-04.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"742\" \/>\n\t<meta property=\"og:image:height\" content=\"372\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"admin\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@lnxhostsupport\" \/>\n<meta name=\"twitter:site\" content=\"@lnxhostsupport\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"admin\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/\"},\"author\":{\"name\":\"admin\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#\\\/schema\\\/person\\\/53a9571ea078cdf350137a1e97423cfb\"},\"headline\":\"How to Install and Switch Python Versions on Ubuntu 22.04\",\"datePublished\":\"2023-07-30T17:30:00+00:00\",\"dateModified\":\"2023-08-29T08:33:30+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/\"},\"wordCount\":609,\"commentCount\":8,\"image\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04.webp\",\"keywords\":[\"python versions\",\"ubuntu\"],\"articleSection\":[\"Python\",\"Tutorials\",\"Ubuntu\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/\",\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/\",\"name\":\"How to Install and Switch Python Versions on Ubuntu 22.04 | LinuxHostSupport\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04.webp\",\"datePublished\":\"2023-07-30T17:30:00+00:00\",\"dateModified\":\"2023-08-29T08:33:30+00:00\",\"author\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#\\\/schema\\\/person\\\/53a9571ea078cdf350137a1e97423cfb\"},\"description\":\"Installing and switching Python versions on Ubuntu 22.04 will be a breeze with our help. Read our guide to find out more. Let's get things going!\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/#primaryimage\",\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04.webp\",\"contentUrl\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/07\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04.webp\",\"width\":742,\"height\":372,\"caption\":\"how to install and switch python versions on ubuntu 22.04\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install and Switch Python Versions on Ubuntu 22.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/\",\"name\":\"LinuxHostSupport\",\"description\":\"Linux Tutorials and Guides\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/#\\\/schema\\\/person\\\/53a9571ea078cdf350137a1e97423cfb\",\"name\":\"admin\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g\",\"caption\":\"admin\"},\"url\":\"https:\\\/\\\/linuxhostsupport.com\\\/blog\\\/author\\\/r0s3admin\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install and Switch Python Versions on Ubuntu 22.04 | LinuxHostSupport","description":"Installing and switching Python versions on Ubuntu 22.04 will be a breeze with our help. Read our guide to find out more. Let's get things going!","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:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install and Switch Python Versions on Ubuntu 22.04 | LinuxHostSupport","og_description":"Installing and switching Python versions on Ubuntu 22.04 will be a breeze with our help. Read our guide to find out more. Let's get things going!","og_url":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/","og_site_name":"LinuxHostSupport","article_publisher":"https:\/\/www.facebook.com\/linuxhostsupport","article_published_time":"2023-07-30T17:30:00+00:00","article_modified_time":"2023-08-29T08:33:30+00:00","og_image":[{"width":742,"height":372,"url":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/07\/how-to-install-and-switch-python-versions-on-ubuntu-22-04.webp","type":"image\/webp"}],"author":"admin","twitter_card":"summary_large_image","twitter_creator":"@lnxhostsupport","twitter_site":"@lnxhostsupport","twitter_misc":{"Written by":"admin","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/#article","isPartOf":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/"},"author":{"name":"admin","@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb"},"headline":"How to Install and Switch Python Versions on Ubuntu 22.04","datePublished":"2023-07-30T17:30:00+00:00","dateModified":"2023-08-29T08:33:30+00:00","mainEntityOfPage":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/"},"wordCount":609,"commentCount":8,"image":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/07\/how-to-install-and-switch-python-versions-on-ubuntu-22-04.webp","keywords":["python versions","ubuntu"],"articleSection":["Python","Tutorials","Ubuntu"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/","url":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/","name":"How to Install and Switch Python Versions on Ubuntu 22.04 | LinuxHostSupport","isPartOf":{"@id":"https:\/\/linuxhostsupport.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/#primaryimage"},"image":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/#primaryimage"},"thumbnailUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/07\/how-to-install-and-switch-python-versions-on-ubuntu-22-04.webp","datePublished":"2023-07-30T17:30:00+00:00","dateModified":"2023-08-29T08:33:30+00:00","author":{"@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb"},"description":"Installing and switching Python versions on Ubuntu 22.04 will be a breeze with our help. Read our guide to find out more. Let's get things going!","breadcrumb":{"@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/#primaryimage","url":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/07\/how-to-install-and-switch-python-versions-on-ubuntu-22-04.webp","contentUrl":"https:\/\/linuxhostsupport.com\/blog\/wp-content\/uploads\/2023\/07\/how-to-install-and-switch-python-versions-on-ubuntu-22-04.webp","width":742,"height":372,"caption":"how to install and switch python versions on ubuntu 22.04"},{"@type":"BreadcrumbList","@id":"https:\/\/linuxhostsupport.com\/blog\/how-to-install-and-switch-python-versions-on-ubuntu-22-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/linuxhostsupport.com\/blog\/"},{"@type":"ListItem","position":2,"name":"How to Install and Switch Python Versions on Ubuntu 22.04"}]},{"@type":"WebSite","@id":"https:\/\/linuxhostsupport.com\/blog\/#website","url":"https:\/\/linuxhostsupport.com\/blog\/","name":"LinuxHostSupport","description":"Linux Tutorials and Guides","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/linuxhostsupport.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/linuxhostsupport.com\/blog\/#\/schema\/person\/53a9571ea078cdf350137a1e97423cfb","name":"admin","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/ed83c63a34114218f977e1f913be03906d17c7d9c800788fcac345f5edaf6cfa?s=96&d=mm&r=g","caption":"admin"},"url":"https:\/\/linuxhostsupport.com\/blog\/author\/r0s3admin\/"}]}},"_links":{"self":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/1840","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/comments?post=1840"}],"version-history":[{"count":6,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/1840\/revisions"}],"predecessor-version":[{"id":1897,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/posts\/1840\/revisions\/1897"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/media\/1896"}],"wp:attachment":[{"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/media?parent=1840"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/categories?post=1840"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhostsupport.com\/blog\/wp-json\/wp\/v2\/tags?post=1840"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}