Python PIP Tutorial

In this Python tutorial, you will learn the basics of PIP. PIP Installs Python or PIP Installs Packages is a package management solution for Python. In this tutorial, you will learn how to stay up-to-date, install packages, uninstall packages, and more.

Note: There are some bash commands in this tutorial that may not work for you if you use Windows.


Check the version you are using. If they are the same, you can use either pip or pip3 as you wish. In the rest of this tutorial, I’ll be using pip instead of pip3.

pip --version
pip3 --version

If PIP needs upgrading, then you can use the following command.

python -m pip install --upgrade pip

For help, you can use the following command.

pip help

For the manual, you can use this command.

man pip

List out all installed packages.

pip list

Use some bash commands to filter through your list.

pip list | grep "packagename"

List out more details about a specific package.

pip show packagename

Display a list of all packages along with the version.

pip freeze

Output the list into a .txt file.

pip freeze > pip.txt

Output our new file to the console.

cat pip.txt

Install a PIP package.

pip install packagename

Install a specific version of a PIP package

pip install packagename==1.0.0

Install multiple PIP packages from a .txt file.

pip install -r pip.txt

Uninstall a package.

pip uninstall packagename