Python Package Management with pip3

“pip” is a default package manager for python packages/modules.

You can install pip using the following command:

sudo apt install python3-pip

The pip3 binary in installed in /usr/bin folder.

Check the pip version:

pip3 --version

or

python3 -m pip --version

You can upgrade “pip” using the following command:

sudo -H python3 -m pip install --upgrade pip

The table below lists some commonly used of pip command:

CommandDescription
python3 -m pip –helpDisplay pip help
python3 -m pip listLists the installed packages
python3 -m pip list -vLists the installed packages along with the install path
python3 -m pip search oauthSearches for packages with “oauth” string
python3 -m pip install pandasInstalls the latest version of the package “pandas”
python3 -m pip show pandasShows the details of the installed package pandas
python3 -m pip uninstall pandasUninstalls the package pandas
pip freezeDisplays the lists of packages installed along with it’s version in the format:
[package_name_1]==[version]
[package_name_2]==[version]