Install python in linux ubuntu (Easiest Method)

Agenda: How To install python in Linux ubuntu20.04

Python is one of the most popular and powerful languages. Which is mostly used for scripting Operating systems, Machine Learning, Deep learning, etc.








 Before installing python check your OS has a default python package or Not by the command below

python --version


 

If your Linux system does not have python ...Follow these steps to install the python package.

Install in Debian Based System like Ubuntu.

Step 1: First, install development packages required to build Python.

sudo apt update
$ sudo apt install build-essential zlib1g-dev \
libncurses5-dev libgdbm-dev libnss3-dev \
libssl-dev libreadline-dev libffi-dev curl

Step 2: Download the stable latest release of Python 3

Visit the official Python website and download the latest version of Python 3. After the download is complete, you have a .tar.xz archive file (a "tarball") containing the source code of Python.


Step 3: Extract the tarball 

Once the download is complete, extract the tarball by either using the extractor application of your choice or the Linux tar command, for example:
$ tar -xf Python-3.?.?.tar.xz

Step 4: Configure the script

Once the Python tarball has been extracted, navigate to the configure script and execute it in your Linux terminal with:
$ cd Python-3.*
./configure
The configuration may take some time. Wait until it is successfully finished before proceeding.

Step 5: Start the build process

If you already have a version of Python installed on your system and you want to install the new version alongside it, use this command: 
$ sudo make altinstall
The build process may take some time. If you want to replace your current version of Python with this new version, you should uninstall your current Python package using your package manager (such as apt or dnf) and then install: 
$ sudo make install

Step 6: Verify Your Installation

If you haven't encountered any errors, the latest Python is now installed on your Linux system. To verify it, write one of these commands in your terminal:
python3 --version
OR
python --version



I hope you like this post. Please make sure you have bookmarked my blog so you can view every information you needed. Please share it with your friends so Google Baba Thinks my Blogs is useful and gives me space on search results.






Post a Comment

Previous Post Next Post