The pip is a package manager for Python that allows to download and install various packages from Python Package Index (PyPI) repository.
This tutorial demonstrates how to install pip on Ubuntu 20.04.
Install pip
Download get-pip.py
script:
wget -q https://bootstrap.pypa.io/get-pip.py
Execute downloaded script to install pip for Python 3:
sudo python3 get-pip.py
Once installation is complete, we can check pip version:
pip3 --version
The get-pip.py
script is no longer needed, remove it:
rm -rf get-pip.py
Testing pip
The pip3 install
command can be used to install packages. For example, the following command installs pytz package:
sudo pip3 install pytz
The following command allows getting a list of installed packages:
pip3 list
Uninstall pip
If you want to completely remove pip and related dependencies, run the following command:
sudo pip3 uninstall -y pip wheel
Remove pip cache:
sudo rm -rf /root/.cache/pip
rm -rf ~/.cache/pip
Leave a Comment
Cancel reply