{"id":92724,"date":"2021-12-03T23:18:40","date_gmt":"2021-12-04T04:18:40","guid":{"rendered":"https:\/\/www.inmotionhosting.com\/support\/?p=92724"},"modified":"2025-03-21T17:42:08","modified_gmt":"2025-03-21T21:42:08","slug":"install-python-3-9-centos-7","status":"publish","type":"post","link":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/","title":{"rendered":"How to Install Python 3.9 on CentOS 7"},"content":{"rendered":"<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"538\" src=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7-1024x538.png\" alt=\"\" class=\"wp-image-92758\" srcset=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7-1024x538.png 1024w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7-300x158.png 300w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7-768x403.png 768w, https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7.png 1200w\" sizes=\"auto, (min-width: 1360px) 876px, (min-width: 960px) calc(61.58vw + 51px), calc(100vw - 80px)\" \/><\/figure>\n\n\n\n<p>One of the most popular programming languages is <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/website-design\/python-programming\/\">Python<\/a>, used in everything from low-level scripting to high-level application development. As of 2020, Python 3 has taken the place of its predecessor, <a href=\"https:\/\/www.inmotionhosting.com\/support\/website\/how-to-install-python-on-your-dedicated-server\/\">Python 2<\/a>. Python 3 can be installed on most modern operating systems, including Windows and CentOS. In this article, we will outline how to install Python 3.9 on CentOS 7.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Python Package Manager PIP<\/h2>\n\n\n\n<ol class=\"wp-block-list article_list\">\n<li>Before we can install the Python package manager, PIP, we need to enable additional software repositories using the following command:<pre class=\"wp-block-preformatted\">sudo yum install epel-release<\/pre><\/li>\n\n\n\n<li>Next, install PIP using the following command:<pre class=\"wp-block-preformatted\">sudo yum install python-pip<\/pre><\/li>\n\n\n\n<li>Finally, confirm that the installation was successful using the following command:<pre class=\"wp-block-preformatted\">pip --version<\/pre><\/li>\n\n\n\n<li>If successful, the system should display the PIP version as well as your current Python version.<\/li>\n<\/ol>\n\n\n\n<h2 class=\"wp-block-heading\">Installing Python 3.9\u00a0<\/h2>\n\n\n\n<p>Now that we have PIP installed, we can proceed with installing the latest version of Python, 3.9.\u00a0<\/p>\n\n\n\n<ol class=\"wp-block-list article_list\">\n<li>Before installing Python you will first need to install the requisite software packages using the following command:\u00a0<br><pre class=\"wp-block-preformatted\">sudo yum install gcc openssl-devel bzip2-devel libffi-devel zlib-devel<\/pre><\/li>\n\n\n\n<li>Once that is done, navigate to the \/usr\/local\/src directory:<pre class=\"wp-block-preformatted\">cd \/usr\/local\/src<\/pre><\/li>\n\n\n\n<li>Download the latest version of Python using the wget command as follows:<pre class=\"wp-block-preformatted\">wget <a href=\"https:\/\/www.python.org\/ftp\/python\/3.9.21\/Python-3.9.21.tgz\">https:\/\/www.python.org\/ftp\/python\/3.9.21\/Python-3.9.21.tgz<\/a><\/pre><\/li>\n\n\n\n<li>Once the file is downloaded, extract it using the following command:<pre class=\"wp-block-preformatted\">tar -xvf Python-3.9.21.tgz<\/pre><\/li>\n\n\n\n<li>Once the file has extracted, move into the directory that was created<pre>cd Python-3.9.6<\/pre><\/li>\n\n\n\n<li>Configure the installation using the following command:<pre class=\"wp-block-preformatted\">.\/configure \u2014-prefix=\/usr\/local\/<\/pre><\/li>\n\n\n\n<li>Run the following command:<pre>sudo make<\/pre><\/li>\n\n\n\n<li>Next, build Python using the following command:<pre class=\"wp-block-preformatted\">sudo make altinstall<\/pre><\/li>\n\n\n\n<li>After the installation process has finished, confirm the version using the following command:<pre class=\"wp-block-preformatted\">python3.9 --version<\/pre><\/li>\n<\/ol>\n\n\n\n<p>Congratulations, you have successfully installed Python 3.9 and PIP!<\/p>\n\n\n<div class=\"jumbotron\">Trust your business to an industry leader in fast and reliable website hosting solutions. InMotion Hosting offers secure <a href=\"https:\/\/www.inmotionhosting.com\/web-hosting\">web hosting<\/a> with 99.99% uptime, 24\/7 expert human support, and 100% money-back guarantee.<\/div>\n","protected":false},"excerpt":{"rendered":"<p>One of the most popular programming languages is Python, used in everything from low-level scripting to high-level application development. As of 2020, Python 3 has taken the place of its predecessor, Python 2. Python 3 can be installed on most modern operating systems, including Windows and CentOS. In this article, we will outline how to<a class=\"moretag\" href=\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/\"> Read More ><\/a><\/p>\n","protected":false},"author":57020,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[4308],"tags":[],"class_list":["post-92724","post","type-post","status-publish","format-standard","hentry","category-linux"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.1.1 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>How to Install Python 3.9 on CentOS 7 | InMotion Hosting<\/title>\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.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/\" \/>\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.9 on CentOS 7 | InMotion Hosting\" \/>\n<meta property=\"og:description\" content=\"One of the most popular programming languages is Python, used in everything from low-level scripting to high-level application development. As of 2020, Python 3 has taken the place of its predecessor, Python 2. Python 3 can be installed on most modern operating systems, including Windows and CentOS. In this article, we will outline how to Read More &gt;\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/\" \/>\n<meta property=\"og:site_name\" content=\"InMotion Hosting Support Center\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/inmotionhosting\/\" \/>\n<meta property=\"article:published_time\" content=\"2021-12-04T04:18:40+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-21T21:42:08+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7-1024x538.png\" \/>\n<meta name=\"author\" content=\"Jesse Owens\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:site\" content=\"@InMotionHosting\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Jesse Owens\" \/>\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.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/\"},\"author\":{\"name\":\"Jesse Owens\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/db97af6358b0c1726e01e49180e5f71c\"},\"headline\":\"How to Install Python 3.9 on CentOS 7\",\"datePublished\":\"2021-12-04T04:18:40+00:00\",\"dateModified\":\"2025-03-21T21:42:08+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/\"},\"wordCount\":246,\"commentCount\":6,\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7-1024x538.png\",\"articleSection\":[\"Linux\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/\",\"name\":\"How to Install Python 3.9 on CentOS 7 | InMotion Hosting\",\"isPartOf\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7-1024x538.png\",\"datePublished\":\"2021-12-04T04:18:40+00:00\",\"dateModified\":\"2025-03-21T21:42:08+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#primaryimage\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7.png\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7.png\",\"width\":1200,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.inmotionhosting.com\/support\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to Install Python 3.9 on CentOS 7\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#website\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"name\":\"InMotion Hosting Support Center\",\"description\":\"Web Hosting Support &amp; Tutorials\",\"publisher\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#organization\",\"name\":\"InMotion Hosting\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"contentUrl\":\"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg\",\"width\":696,\"height\":696,\"caption\":\"InMotion Hosting\"},\"image\":{\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/inmotionhosting\/\",\"https:\/\/x.com\/InMotionHosting\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/db97af6358b0c1726e01e49180e5f71c\",\"name\":\"Jesse Owens\",\"url\":\"https:\/\/www.inmotionhosting.com\/support\/author\/jesseo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to Install Python 3.9 on CentOS 7 | InMotion Hosting","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.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/","og_locale":"en_US","og_type":"article","og_title":"How to Install Python 3.9 on CentOS 7 | InMotion Hosting","og_description":"One of the most popular programming languages is Python, used in everything from low-level scripting to high-level application development. As of 2020, Python 3 has taken the place of its predecessor, Python 2. Python 3 can be installed on most modern operating systems, including Windows and CentOS. In this article, we will outline how to Read More >","og_url":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/","og_site_name":"InMotion Hosting Support Center","article_publisher":"https:\/\/www.facebook.com\/inmotionhosting\/","article_published_time":"2021-12-04T04:18:40+00:00","article_modified_time":"2025-03-21T21:42:08+00:00","og_image":[{"url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7-1024x538.png","type":"","width":"","height":""}],"author":"Jesse Owens","twitter_card":"summary_large_image","twitter_creator":"@InMotionHosting","twitter_site":"@InMotionHosting","twitter_misc":{"Written by":"Jesse Owens","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#article","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/"},"author":{"name":"Jesse Owens","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/db97af6358b0c1726e01e49180e5f71c"},"headline":"How to Install Python 3.9 on CentOS 7","datePublished":"2021-12-04T04:18:40+00:00","dateModified":"2025-03-21T21:42:08+00:00","mainEntityOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/"},"wordCount":246,"commentCount":6,"publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7-1024x538.png","articleSection":["Linux"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/","url":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/","name":"How to Install Python 3.9 on CentOS 7 | InMotion Hosting","isPartOf":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#primaryimage"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#primaryimage"},"thumbnailUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7-1024x538.png","datePublished":"2021-12-04T04:18:40+00:00","dateModified":"2025-03-21T21:42:08+00:00","breadcrumb":{"@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#primaryimage","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7.png","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2021\/12\/install-python-on-centos-7.png","width":1200,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/install-python-3-9-centos-7\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.inmotionhosting.com\/support\/"},{"@type":"ListItem","position":2,"name":"How to Install Python 3.9 on CentOS 7"}]},{"@type":"WebSite","@id":"https:\/\/www.inmotionhosting.com\/support\/#website","url":"https:\/\/www.inmotionhosting.com\/support\/","name":"InMotion Hosting Support Center","description":"Web Hosting Support &amp; Tutorials","publisher":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.inmotionhosting.com\/support\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.inmotionhosting.com\/support\/#organization","name":"InMotion Hosting","url":"https:\/\/www.inmotionhosting.com\/support\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/","url":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","contentUrl":"https:\/\/www.inmotionhosting.com\/support\/wp-content\/uploads\/2023\/02\/inmotion-hosting-logo-yoast.jpg","width":696,"height":696,"caption":"InMotion Hosting"},"image":{"@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/inmotionhosting\/","https:\/\/x.com\/InMotionHosting"]},{"@type":"Person","@id":"https:\/\/www.inmotionhosting.com\/support\/#\/schema\/person\/db97af6358b0c1726e01e49180e5f71c","name":"Jesse Owens","url":"https:\/\/www.inmotionhosting.com\/support\/author\/jesseo\/"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"primary_category":{"id":4308,"name":"Linux","slug":"linux","link":"https:\/\/www.inmotionhosting.com\/support\/server\/linux\/"},"_links":{"self":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/92724","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/users\/57020"}],"replies":[{"embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/comments?post=92724"}],"version-history":[{"count":11,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/92724\/revisions"}],"predecessor-version":[{"id":129796,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/posts\/92724\/revisions\/129796"}],"wp:attachment":[{"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/media?parent=92724"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/categories?post=92724"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.inmotionhosting.com\/support\/wp-json\/wp\/v2\/tags?post=92724"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}