![Image [1] - Python 3.9 Offline Installation Tutorial on Linux: Easily install the latest version of Python without an internet connection!](https://www.361sale.com/wp-content/uploads/2023/02/pexels-kevin-ku-577585-1-1024x768.jpg)
When there is no Internet connection on your Linux system or you wish to install offline, you can install Python version 3.9 by following these steps.
Step 1: Download Python 3.9 Source Code
On any machine with an Internet connection, using a browser or command line, go to the official Python website (https://www.python.org/downloads/source/) and download Python The source code zip for 3.9 (.tar.xz or .tar.gz format).
Step 2: Transfer Python 3.9 Source Code to Linux System
Transfer the downloaded Python 3.9 source code zip package to the target Linux system, which can be transferred to the target system via USB device, network share, SCP and so on.
Step 3: Unzip Python 3.9 Source Code
To extract the Python 3.9 source tarball on a Linux system, use the following command:
bashCopy codetar -xJf Python-3.9.5.tar.xz # If downloading in .tar.xz formattar -xJf Python-3.9.5.tar.xz # If downloading in .tar.xz formattar -xJf Python-3.9.5.tar.xz # If downloading in .tar.xz format
maybe
bashCopy codetar -xzf Python-3.9.5.tar.gz # If downloading in .tar.gz formattar -xzf Python-3.9.5.tar.gz # If downloading in .tar.gz formattar -xzf Python-3.9.5.tar.gz # If downloading in .tar.gz format
The above command will extract the Python 3.9 source code to the current directory.
Step 4: Installation of compilation tools and dependent libraries
Before compiling and installing Python 3.9, you need to install some compilation tools and dependent libraries. These tools and libraries can be installed on a Linux system using the following commands:
bashCopy codesudo apt update # update package listsudo apt install build-essential libssl-dev zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libsqlite3-dev libreadline-dev libffi-dev curl # Installation of compilation tools and dependenciessudo apt update # update package list sudo apt install build-essential libssl-dev zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libsqlite3-dev libreadline-dev libffi-dev curl # Installation of compilation tools and dependenciessudo apt update # update package list sudo apt install build-essential libssl-dev zlib1g-dev libncurses5-dev libgdbm-dev libnss3-dev libsqlite3-dev libreadline-dev libffi-dev curl # Installation of compilation tools and dependencies
The above command uses the apt package manager for Debian/Ubuntu based Linux distributions. For other distributions, the tools and libraries can be installed using the appropriate package managers.
Step 5: Compile and Install Python 3.9
In the unzipped Python 3.9 folder, execute the following command to install Python 3.9:
goCopy code. /configuresudo make installsudo make install. /configure sudo make install sudo make install. /configure sudo make install sudo make install
The above commands will perform the configuration, compilation and installation of Python 3.9.. /configure
command to configure Python 3.9.make
command to compile the source code.sudo make install
command to install Python 3.9 into the system directory.
Step 6: Verify Installation
Once the installation is complete, you can verify that Python 3.9 was successfully installed using the following command:
cssCopy codepython3.9 --versionpython3.9 --versionpython3.9 --version
If the output shows the version number of Python 3.9.x, the installation was successful.
Python 3.9 has now been successfully installed offline on Linux systems. You can install Python 3.9 offline using thepython3.9
command to start the Python 3.9 interpreter and begin developing with it.
Link to this article:https://www.361sale.com/en/4794
The article is copyrighted and must be reproduced with attribution.
No comments