HomeHOWTOSHow To Install Python 3.11 on Rocky Linux 9|AlmaLinux 9

How To Install Python 3.11 on Rocky Linux 9|AlmaLinux 9

This guide will provide step-by-step instructions on how to install Python 3.11 on Rocky Linux 9|AlmaLinux 9. Python is one of the most popular programming languages used by novice and seasoned developers. It is great for beginners and makes it simple to construct web applications since it is simple to grasp and employs a more legible language than any other programming language.

Python has also been widely used for scripting, allowing Linux systems to use automated operations. It is also a high-level, object-oriented programming language with integrated dynamic semantics that is mostly used for developing websites and mobile applications.

Python 3.11 was released on October 24, 2022, and it offers a range of fascinating improvements for developers to explore and experiment with. These improvements include:

  • Structural Pattern Matching: Similar to Python 3.10, Python 3.11 enhances Structural Pattern Matching to add new capabilities and improve performance.
  • Better Type Hinting: Python 3.11 makes it easier to use and extend the type hinting system.
  • Improved error messages: Python 3.11 continues to improve the error messages and traceback information for more informative and actionable diagnostics.
  • Improved AsyncIO: AsyncIO, the Python library for asynchronous I/O programming, has been improved in Python 3.11 to make it more efficient and easier to use.
  • Enhanced Security: Python 3.11 has improved security by supporting the OpenSSL 3.0 library, which provides better security and performance.
  • New modules: Python 3.11 includes several new modules, including graphlib for working with graphs and jankson for parsing JSON.

Follow the below steps to install Python 3.11 on Rocky Linux 9|AlmaLinux 9

Step 1 ~ Update Rocky Linux 9|AlmaLinux 9 system

As usual, the first step is to update your system before we install Python 3.11 on Rocky Linux 9|AlmaLinux 9:

sudo yum update

Step 2 ~ Install Required packages

Install some packages through the below command:

sudo yum install openssl-devel bzip2-devel libffi-devel

Output:

Extra Packages for Enterprise Linux 9 - x86_64   37 kB/s |  60 kB     00:01    
Dependencies resolved.
================================================================================
 Package             Architecture Version                 Repository       Size
================================================================================
Installing:
 bzip2-devel         x86_64       1.0.8-8.el9             appstream       214 k
 libffi-devel        x86_64       3.4.2-7.el9             appstream        29 k
 openssl-devel       x86_64       1:3.0.1-41.el9_0        appstream       2.9 M

Transaction Summary
================================================================================
Install  3 Packages

Total download size: 3.2 M
Installed size: 5.0 M
Is this ok [y/N]: y

Install development tools that aid in the creation, maintenance, and support of other programs and applications.

sudo yum groupinstall "Development Tools"

Output:

Dependencies resolved.
====================================================================================================================================================================================================================
 Package                                                         Architecture                           Version                                                     Repository                                 Size
====================================================================================================================================================================================================================
Installing group/module packages:
 asciidoc                                                        noarch                                 9.1.0-3.el9                                                 appstream                                 238 k
 autoconf                                                        noarch                                 2.69-38.el9                                                 appstream                                 666 k
 automake                                                        noarch                                 1.16.2-6.el9                                                appstream                                 662 k
 bison                                                           x86_64                                 3.7.4-5.el9                                                 appstream                                 921 k
 byacc                                                           x86_64                                 2.0.20210109-4.el9                                          appstream                                  88 
..........

Step 3 ~ Download Python 3.11 on Rocky Linux 9|AlmaLinux 9

Get the download link for the Python version you intend to install first from this page.
Python 3.11 will be used in this course.

Use the following command to download the file:

wget https://www.python.org/ftp/python/3.11.0/Python-3.11.0a4.tgz

To extract the archive, use:

tar -xzf Python-3.11.0a4.tgz

Step 4 ~ Install Python 3.11 on Rocky Linux 9|AlmaLinux 9

To install the Python version you just downloaded, navigate to the following directory:

cd Python-3.11.0a4

Next, carry out the following command:

./configure --enable-optimizations

Sample output:

........
checking for stdlib extension module _gdbm... missing
checking for stdlib extension module nis... missing
checking for stdlib extension module _sqlite3... disabled
checking for stdlib extension module _uuid... missing
checking for stdlib extension module zlib... yes
checking for stdlib extension module _bz2... yes
checking for stdlib extension module _lzma... yes
checking for stdlib extension module _ssl... yes
checking for stdlib extension module _hashlib... yes
checking for stdlib extension module _testcapi... yes
checking for stdlib extension module _testinternalcapi... yes
checking for stdlib extension module _testbuffer... yes
checking for stdlib extension module _testimportmultiple... yes
checking for stdlib extension module _testmultiphase... yes
checking for stdlib extension module _xxtestfuzz... yes
checking for stdlib extension module _ctypes_test... yes
checking for stdlib extension module xxlimited... yes
checking for stdlib extension module xxlimited_35... yes
configure: creating ./config.status
config.status: creating Makefile.pre
config.status: creating Misc/python.pc
config.status: creating Misc/python-embed.pc
config.status: creating Misc/python-config.sh
config.status: creating Modules/Setup.stdlib
config.status: creating Modules/ld_so_aix
config.status: creating pyconfig.h
configure: creating Modules/Setup.local
configure: creating Makefile

Lastly, compile Python (while leaving the default version in place):

sudo make altinstall

This procedure may take some time. So be patient.

Check to see if you have Python 3.11.0a4 installed. When it’s done, you command below:

$ python3.11 --version
Python 3.11.0a4

Cheers! You are done! We have successfully walked through how to install Python 3.11 on Rocky Linux 9|AlmaLinux 9.

Conclusion

That’s the end of it. You have now installed Python 3.11 most recent version on Rocky Linux 9|AlmaLinux 9.

Read more about Python.

Some other manuals include:

- Advertisment -

Recent posts

LEAVE A REPLY

Please enter your comment!
Please enter your name here