Hello, friends. In this short, but productive post, you will learn how to install PIP on Ubuntu 22.04 | Linux Mint 21 which is a package gesture for Python.
So, according to the official PIP documentation,
pip is the package installer for Python. You can use it to install packages from the Python package index and other indexes.
That is, with PIP you can install, uninstall, and update packages made with Python. These packages can be entire applications or simple libraries.
Needless to say that PIP is open source, and we can install it on almost any desktop operating system.
Let’s go for it.
Install Python Pip on Ubuntu 22.04 | Linux Mint 21
As expected, Pip is present in the official Ubuntu and Linux Mint repositories, making the process faster.
So, first, open a terminal and update the whole system
sudo apt update
sudo apt upgrade
Thereafter, install both the Python development libraries and PIP.
sudo apt install python3-dev python3-pip
Then, verify the installed version as follows:
You will get an output similar to this
pip 22.0.2 from /usr/lib/python3/dist-packages/pip (python 3.10)
Before using PIP…
Before using it, you should do two things, the first is to update it to its latest version. To do this, run.
pip3 install pip -U
Now if you show again the installed version
Successfully installed pip-22.2.2
As you can see, there is an update in the version number.
The second thing you have to do is to add the
/home/[your-user]/.local/bin directory to the PATH. It is in this directory that PIP stores the binaries of downloaded applications or Python libraries.
If you want additional information about how to add a directory to the PATH, read this post.
And with this, you can use Pip without problems. For example, to install a package.
pip3 install <package>
In this post, you learned how to install PIP on Ubuntu 22.04 that tool will be used later and especially by yourself in python projects.