{"id":13386,"date":"2024-07-18T06:09:58","date_gmt":"2024-07-18T06:09:58","guid":{"rendered":"https:\/\/www.bodhost.com\/kb\/?p=13386"},"modified":"2026-02-26T14:02:10","modified_gmt":"2026-02-26T14:02:10","slug":"how-to-install-python-3-on-ubuntu-20-04-or-22-04","status":"publish","type":"post","link":"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/","title":{"rendered":"How to Install Python 3 on Ubuntu 20.04 or 22.04"},"content":{"rendered":"<p>Python is a popular programming language mostly used for web development, data analysis, artificial intelligence, and more. In this guide, you will learn how to install Python 3 on your Ubuntu 20.04 or 22.04 system quickly and easily.<\/p>\n<ol>\n<li>Start with the Ubuntu Update:<br \/>\nFirst, ensure you have the latest package updated in your system:<br \/>\n<span style=\"text-decoration: underline;\"><strong>sudo apt update<\/strong><\/span><\/li>\n<li>Check your current Python version:<br \/>\nIt is important to check the latest version that you have installed on your system. Check it using:<br \/>\n<span style=\"text-decoration: underline;\"><strong>python \u2013V<\/strong><\/span><\/li>\n<li>Install the supporting software:<br \/>\nIf you install supporting software, you can manage packages and add a PPA repository too.<br \/>\n<span style=\"text-decoration: underline;\"><strong>sudo apt install software-properties-common<\/strong><\/span><\/li>\n<li>Add Deadsnake PPA:<br \/>\nSometimes we might not get the latest Python version, so we need to add Deadsnake PPA to get the newer version.<br \/>\n<strong><span style=\"text-decoration: underline;\">sudo add-apt-repository ppa:deadsnakes\/ppa<\/span><\/p>\n<p><\/strong>Press Enter to continue and update the package list once again:<br \/>\n<span style=\"text-decoration: underline;\"><strong>sudo apt update<\/strong><\/span><\/li>\n<li>Installing Python on Ubuntu:<br \/>\nAfter adding the PPA repository, you can install all the latest versions of Python on Ubuntu. To check if the version is available, use:<br \/>\n<strong><span style=\"text-decoration: underline;\">sudo apt-cache policy python3. X<\/span><br \/>\n<\/strong>(Note: Replace the X with the version you want to install\u2014.11,.12,.13.)<\/li>\n<li>Set the default Python version:<br \/>\nList out all the Python versions available on your system, using:<br \/>\n<strong><span style=\"text-decoration: underline;\">ls \/usr\/bin\/python*<\/span><\/p>\n<p><\/strong>Check if any version is configured as a Python alternative or not. Use:<br \/>\n<strong><span style=\"text-decoration: underline;\">sudo update-alternatives &#8211;list python<\/span><\/p>\n<p><\/strong>If the output is:<br \/>\n<strong><span style=\"text-decoration: underline;\">update-alternatives: error: no alternatives for Python<\/span><\/p>\n<p><\/strong>It means no alternatives are configured for python<\/p>\n<p>To set up all the available versions as alternatives, installed recently, use:<br \/>\n<strong><span style=\"text-decoration: underline;\">sudo update-alternatives &#8211;install \/usr\/bin\/python python \/usr\/bin\/python3.X<\/span><br \/>\n<\/strong>(Note: Replace the X with the version you want to install:10 1,.11 2,.12 4)<\/p>\n<p>Once configured with the available versions against each other, if you want to change the current one and set some other version as the default one, use:<br \/>\n<strong><span style=\"text-decoration: underline;\">sudo update-alternatives &#8211;config python<\/span><\/p>\n<p><\/strong>Choose the version you want to set as the default on Ubuntu by entering the number.<\/p>\n<p>Check your Python version again. Use:<br \/>\n<span style=\"text-decoration: underline;\"><strong>python -V<\/strong><\/span><\/li>\n<\/ol>\n<p>Installing Python 3 on Ubuntu 20.04 or 22.04 is a simple process; by following the steps above in this guide, you can install the latest version of Python and properly configure your system. If you need further assistance, our support team is available to assist 24\/7.<\/p>\n<p>If you are having trouble installing Python on Debian 12, read our next tutorial &gt;&gt;<a href=\"https:\/\/www.bodhost.com\/kb\/how-to-install-python-on-debian-12\/\" target=\"_blank\" rel=\"noopener\"><strong> How to install Python on Debian 12<\/strong><\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Python is a popular programming language mostly used for web development, data analysis, artificial intelligence, and more. In this guide, you will learn how to install Python 3 on your&hellip;<\/p>\n<p><a href=\"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/\" class=\"more-link\">Read More<\/a><\/p>\n","protected":false},"author":5,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[666],"tags":[1550],"class_list":["post-13386","post","type-post","status-publish","format-standard","hentry","category-general","tag-install-python-3-on-ubuntu-20-04-or-22-04"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install Python 3 on Ubuntu 20.04 or 22.04 | bodHOST<\/title>\n<meta name=\"description\" content=\"In this guide, you will learn how to install Python 3 on your Ubuntu 20.04 or 22.04 system quickly and easily.\" \/>\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.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-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 Python 3 on Ubuntu 20.04 or 22.04 | bodHOST\" \/>\n<meta property=\"og:description\" content=\"In this guide, you will learn how to install Python 3 on your Ubuntu 20.04 or 22.04 system quickly and easily.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/\" \/>\n<meta property=\"og:site_name\" content=\"Knowledge Base - bodHOST\" \/>\n<meta property=\"article:published_time\" content=\"2024-07-18T06:09:58+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T14:02:10+00:00\" \/>\n<meta name=\"author\" content=\"Paul Lopez\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Paul Lopez\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\\\/\"},\"author\":{\"name\":\"Paul Lopez\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/566ccff9a2fae4af852be8097b179813\"},\"headline\":\"How to Install Python 3 on Ubuntu 20.04 or 22.04\",\"datePublished\":\"2024-07-18T06:09:58+00:00\",\"dateModified\":\"2026-02-26T14:02:10+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\\\/\"},\"wordCount\":403,\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"keywords\":[\"Install Python 3 on Ubuntu 20.04 or 22.04\"],\"articleSection\":[\"General Discussion\"],\"inLanguage\":\"en-US\"},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\\\/\",\"name\":\"How to Install Python 3 on Ubuntu 20.04 or 22.04 | bodHOST\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\"},\"datePublished\":\"2024-07-18T06:09:58+00:00\",\"dateModified\":\"2026-02-26T14:02:10+00:00\",\"description\":\"In this guide, you will learn how to install Python 3 on your Ubuntu 20.04 or 22.04 system quickly and easily.\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\\\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"General Discussion\",\"item\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/category\\\/general\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Python 3 on Ubuntu 20.04 or 22.04\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#website\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\"},\"alternateName\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#organization\",\"name\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"contentUrl\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/wp-content\\\/uploads\\\/2025\\\/10\\\/Profile-Pic.png\",\"width\":240,\"height\":240,\"caption\":\"Web Hosting Knowledge Base | bodHOST Hosting FAQ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/#\\\/schema\\\/person\\\/566ccff9a2fae4af852be8097b179813\",\"name\":\"Paul Lopez\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g\",\"caption\":\"Paul Lopez\"},\"url\":\"https:\\\/\\\/www.bodhost.com\\\/kb\\\/author\\\/paullopez\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Python 3 on Ubuntu 20.04 or 22.04 | bodHOST","description":"In this guide, you will learn how to install Python 3 on your Ubuntu 20.04 or 22.04 system quickly and easily.","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.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Python 3 on Ubuntu 20.04 or 22.04 | bodHOST","og_description":"In this guide, you will learn how to install Python 3 on your Ubuntu 20.04 or 22.04 system quickly and easily.","og_url":"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/","og_site_name":"Knowledge Base - bodHOST","article_published_time":"2024-07-18T06:09:58+00:00","article_modified_time":"2026-02-26T14:02:10+00:00","author":"Paul Lopez","twitter_card":"summary_large_image","twitter_misc":{"Written by":"Paul Lopez","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/#article","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/"},"author":{"name":"Paul Lopez","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/566ccff9a2fae4af852be8097b179813"},"headline":"How to Install Python 3 on Ubuntu 20.04 or 22.04","datePublished":"2024-07-18T06:09:58+00:00","dateModified":"2026-02-26T14:02:10+00:00","mainEntityOfPage":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/"},"wordCount":403,"publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"keywords":["Install Python 3 on Ubuntu 20.04 or 22.04"],"articleSection":["General Discussion"],"inLanguage":"en-US"},{"@type":"WebPage","@id":"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/","url":"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/","name":"How to Install Python 3 on Ubuntu 20.04 or 22.04 | bodHOST","isPartOf":{"@id":"https:\/\/www.bodhost.com\/kb\/#website"},"datePublished":"2024-07-18T06:09:58+00:00","dateModified":"2026-02-26T14:02:10+00:00","description":"In this guide, you will learn how to install Python 3 on your Ubuntu 20.04 or 22.04 system quickly and easily.","breadcrumb":{"@id":"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.bodhost.com\/kb\/how-to-install-python-3-on-ubuntu-20-04-or-22-04\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"General Discussion","item":"https:\/\/www.bodhost.com\/kb\/category\/general\/"},{"@type":"ListItem","position":2,"name":"How to Install Python 3 on Ubuntu 20.04 or 22.04"}]},{"@type":"WebSite","@id":"https:\/\/www.bodhost.com\/kb\/#website","url":"https:\/\/www.bodhost.com\/kb\/","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","description":"","publisher":{"@id":"https:\/\/www.bodhost.com\/kb\/#organization"},"alternateName":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.bodhost.com\/kb\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.bodhost.com\/kb\/#organization","name":"Web Hosting Knowledge Base | bodHOST Hosting FAQ","url":"https:\/\/www.bodhost.com\/kb\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/","url":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","contentUrl":"https:\/\/www.bodhost.com\/kb\/wp-content\/uploads\/2025\/10\/Profile-Pic.png","width":240,"height":240,"caption":"Web Hosting Knowledge Base | bodHOST Hosting FAQ"},"image":{"@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.bodhost.com\/kb\/#\/schema\/person\/566ccff9a2fae4af852be8097b179813","name":"Paul Lopez","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/c63d9f5400cd5ef87b481a24b2c1a4fb89f1674b6391325326cf13f1e735dff8?s=96&d=mm&r=g","caption":"Paul Lopez"},"url":"https:\/\/www.bodhost.com\/kb\/author\/paullopez\/"}]}},"_links":{"self":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/13386","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/users\/5"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/comments?post=13386"}],"version-history":[{"count":3,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/13386\/revisions"}],"predecessor-version":[{"id":13389,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/posts\/13386\/revisions\/13389"}],"wp:attachment":[{"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/media?parent=13386"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/categories?post=13386"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bodhost.com\/kb\/wp-json\/wp\/v2\/tags?post=13386"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}