{"id":14072,"date":"2024-06-13T13:28:44","date_gmt":"2024-06-13T10:28:44","guid":{"rendered":"http:\/\/local.brightwhiz\/?p=14072"},"modified":"2024-06-13T14:16:18","modified_gmt":"2024-06-13T11:16:18","slug":"how-to-install-python-3-12-on-rocky-linux-8-10-systems","status":"publish","type":"post","link":"http:\/\/local.brightwhiz\/how-to-install-python-3-12-on-rocky-linux-8-10-systems\/","title":{"rendered":"How to Install Python 3.12 on Rocky Linux 8.10 Systems"},"content":{"rendered":"\n
Python is a powerful, versatile programming language widely used in various applications, from web development to data science. With the release of Python 3.12, many developers are eager to take advantage of its new features and improvements. This guide will walk you through the process of installing Python 3.12 on Rocky Linux 8.10.<\/p>\n\n\n\n
Before you start, ensure you have:<\/p>\n\n\n\n
First, update your system to make sure all packages are up to date.<\/p>\n\n\n\n
$ sudo dnf update -y<\/code><\/pre>\n\n\n\nStep 2: Install Required Dependencies<\/h4>\n\n\n\n
To build Python from source, you need to install several development tools and libraries.<\/p>\n\n\n\n
$ sudo dnf groupinstall -y "Development Tools"\n$ sudo dnf install -y bzip2-devel openssl-devel libffi-devel xz-devel wget<\/code><\/pre>\n\n\n\nStep 3: Download Python 3.12 Source Code<\/h4>\n\n\n\n
Download the Python 3.12 source code from the official Python website. You can use wget<\/code> for this purpose.<\/p>\n\n\n\n$ cd \/usr\/src\n$ sudo wget https:\/\/www.python.org\/ftp\/python\/3.12.0\/Python-3.12.0.tgz<\/code><\/pre>\n\n\n\nStep 4: Extract the Tarball<\/h4>\n\n\n\n
Extract the downloaded tarball.<\/p>\n\n\n\n
$ sudo tar xzf Python-3.12.0.tgz\n$ cd Python-3.12.0<\/code><\/pre>\n\n\n\nStep 5: Compile and Install Python<\/h4>\n\n\n\n
Configure the script to prepare the build environment.<\/p>\n\n\n\n
$ sudo .\/configure --enable-optimizations<\/code><\/pre>\n\n\n\nThe --enable-optimizations<\/code> option will optimize the Python binary by running multiple tests, making the build process slower but resulting in a faster Python interpreter.<\/p>\n\n\n\nNext, build and install Python.<\/p>\n\n\n\n
$ sudo make altinstall<\/code><\/pre>\n\n\n\nThe altinstall<\/code> option is used to prevent the new installation from overwriting the default Python binary.<\/p>\n\n\n\nStep 6: Verify the Installation<\/h4>\n\n\n\n
To verify the installation, check the Python version.<\/p>\n\n\n\n
$ python3.12 --version<\/code><\/pre>\n\n\n\nYou should see an output similar to:<\/p>\n\n\n\n
Python 3.12.0<\/code><\/pre>\n\n\n\nStep 7: Set Up Virtual Environment (Optional)<\/h4>\n\n\n\n
It’s a good practice to use a virtual environment for your Python projects to manage dependencies separately. You can create a virtual environment using venv<\/code>.<\/p>\n\n\n\nFirst, install the venv<\/code> module if it’s not already installed.<\/p>\n\n\n\n$ sudo dnf install -y python3.12-venv<\/code><\/pre>\n\n\n\nCreate a virtual environment.<\/p>\n\n\n\n
$ python3.12 -m venv myenv<\/code><\/pre>\n\n\n\nActivate the virtual environment.<\/p>\n\n\n\n
$ source myenv\/bin\/activate<\/code><\/pre>\n\n\n\nNow, you can install packages within this isolated environment using pip<\/code>.<\/p>\n\n\n\nConclusion<\/h4>\n\n\n\n
You have successfully installed Python 3.12 on your Rocky Linux 8.10 system. This installation allows you to take advantage of the latest features and improvements in Python 3.12. Whether you are developing web applications, working on data analysis, or automating tasks, Python 3.12 provides a powerful and efficient platform for your projects.<\/p>\n\n\n\n
For more information and further reading, check out the official Python documentation<\/a> and the Rocky Linux documentation<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"Python is a powerful, versatile programming language widely used in various applications, from web development to data science. With the release of Python 3.12, many developers are eager to take…<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[9,25,27,28,16,18],"tags":[193,354,424,433,475,1268,531,573,591],"yoast_head":"\n
How to Install Python 3.12 on Rocky Linux 8.10 Systems<\/title>\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\t\n\t\n\t\n