How to install pip in linux
Pip is a package management system that simplifies installation and management of software packages written in Python such as those found in the Python Package Index (PyPI). Pip is not installed by default on Ubuntu 18.04, but the installation is pretty straightforward.
In this tutorial, we will show you how to install Python Pip on Ubuntu 18.04 using the apt
package manager. We will also walk you through the basics of installing and managing Python packages with pip.
Installation
Update your system
It is always a good idea to update before trying to install a new package. Run the command below:
sudo apt-get update
Installing pip for Python 3
If Python 3 has already been installed on the system, execute the command below to install pip3:
sudo apt-get -y install python3-pip
Once the installation is complete, verify the installation by checking the pip version:
pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8) (That’s what return for me)
Installing pip for Python 2
Python 2 is not installed by default in Ubuntu 18.04. To install Python 2 and pip for Python 2 after you update your ubuntu, do the following steps:
sudo apt install python-pip
The command above will install Python2, Pip and all the dependencies required for building Python modules.
Once the installation is complete, verify the installation by checking the pip version:
pip --version
The version number may vary, but it will look something like this:
pip 9.0.1 from /usr/lib/python2.7/dist-packages (python 2.7)
good luck :)