{"id":11305,"date":"2021-10-29T10:11:03","date_gmt":"2021-10-29T10:11:03","guid":{"rendered":"https:\/\/linuxways.net\/?p=11305"},"modified":"2021-10-29T10:11:03","modified_gmt":"2021-10-29T10:11:03","slug":"how-to-install-python-3-10-on-rocky-8","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/red-hat\/how-to-install-python-3-10-on-rocky-8\/","title":{"rendered":"How to Install Python 3.10 on Rocky 8"},"content":{"rendered":"<p>Python released its latest stable version &#8211; Python 3.10 &#8211; on October 04, 2021. This is icing on the cake after marking its 30th anniversary earlier this year. The latest Python upgrade offers an array of <a href=\"https:\/\/www.python.org\/downloads\/release\/python-3100rc1\/\">several new features<\/a> which enhances user experience and functionality.<\/p>\n<p>In this tutorial, we walk you through the installation of Python 3.10 on Rocky Linux 8.<\/p>\n<h2><strong>Step 1: Install dependencies<\/strong><\/h2>\n<p>First, it\u2019s prudent that we begin by refreshing the software packages and repositories on Rocky Linux as shown.<\/p>\n<p><strong>$ sudo dnf update<\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"898\" height=\"211\" class=\"wp-image-11306\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-379.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-379.png 898w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-379-300x70.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-379-768x180.png 768w\" sizes=\"auto, (max-width: 898px) 100vw, 898px\" \/><\/p>\n<p>Once done, install the dependencies including the GCC compiler which will be needed in compiling the source code.<\/p>\n<pre><strong>$ sudo dnf install wget make gcc bzip2-devel openssl-devel zlib-devel libffi-devel<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"897\" height=\"241\" class=\"wp-image-11307\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-380.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-380.png 897w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-380-300x81.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-380-768x206.png 768w\" sizes=\"auto, (max-width: 897px) 100vw, 897px\" \/><\/p>\n<h2><strong>Step 2: Download Python 3.10.0 source file<\/strong><\/h2>\n<p>The next step is to download the Python source code file. To do this, run the following command.<\/p>\n<pre><strong>$ wget https:\/\/www.python.org\/ftp\/python\/3.10.0\/Python-3.10.0.tgz<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"866\" height=\"272\" class=\"wp-image-11308\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-381.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-381.png 866w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-381-300x94.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-381-768x241.png 768w\" sizes=\"auto, (max-width: 866px) 100vw, 866px\" \/><\/p>\n<p>Once you have downloaded the compressed file, extract it. The file is quite small and the extraction process takes a very short time.<\/p>\n<pre><strong>$ tar -xvf Python-3.10.0.tgz<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"184\" class=\"wp-image-11309\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-382.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-382.png 700w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-382-300x79.png 300w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<h2><strong>Step 3: Install Python 3.10.0 on Rocky Linux 8<\/strong><\/h2>\n<p>When the extraction is done, navigate to the uncompressed directory.<\/p>\n<pre><strong>$ cd Python-3.10.0<\/strong><\/pre>\n<p>And run the configuration script which performs a checklist to ensure that all the prerequisites are met before the installation begins.<\/p>\n<pre><strong>$ .\/configure --enable-optimizations<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"713\" height=\"196\" class=\"wp-image-11310\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-383.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-383.png 713w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-383-300x82.png 300w\" sizes=\"auto, (max-width: 713px) 100vw, 713px\" \/><\/p>\n<p>The <strong>&#8211;enable-optimizations<\/strong> option optimizes the Python binaries by running several tests, although it takes much longer to complete. Nonetheless this should take long, and you should be done within a minute or two.<\/p>\n<p>To commence the build process, run the <strong>make <\/strong>command as follows. Here, the option denotes the <strong>-j <\/strong>flag of CPU cores. You can find out the number of CPU cores using the <strong>nproc <\/strong>command.<\/p>\n<pre><strong>$ nproc<\/strong><\/pre>\n<p>Back to building the source code. Run the <strong>make <\/strong>command<\/p>\n<pre><strong>$ make -j 2<\/strong><\/pre>\n<p>Here\u2019s a sample of the output.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"792\" height=\"207\" class=\"wp-image-11311\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-384.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-384.png 792w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-384-300x78.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-384-768x201.png 768w\" sizes=\"auto, (max-width: 792px) 100vw, 792px\" \/><\/p>\n<p>Lastly, compile the source code by running the following command:<\/p>\n<pre><strong>$ sudo make altinstall<\/strong><\/pre>\n<p>Once the compilation is complete, verify the Python version installed as follows.<\/p>\n<pre><strong>$ python3.10 --version<\/strong><\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"528\" height=\"95\" class=\"wp-image-11312\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-385.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-385.png 528w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/10\/word-image-385-300x54.png 300w\" sizes=\"auto, (max-width: 528px) 100vw, 528px\" \/><\/p>\n<p>From the output, we can confirm that Python has been successfully installed.<\/p>\n<p>And this wraps up our guide. We have successfully installed Python 3.10 on Rocky Linux 8.<\/p>","protected":false},"excerpt":{"rendered":"<p>Python released its latest stable version &#8211; Python 3.10 &#8211; on October 04, 2021. This is icing on the cake after marking its 30th anniversary earlier this year.&hellip;<\/p>","protected":false},"author":1,"featured_media":11682,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[165],"tags":[10,636],"class_list":["post-11305","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-red-hat","tag-python","tag-rocky-8"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11305","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=11305"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/11305\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/11682"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=11305"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=11305"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=11305"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}