DEV Community

SittingDev
SittingDev

Posted on • Originally published at sittingdev.com

Python PIP Tutorial - Basics for Beginners

In this Python tutorial you will learn the basics of PIP. You will learn how to stay up-to-date, install packages, uninstall packages, and more.

PIP which is known as PIP Installs Python or PIP Installs Packages. Whatever you want to call it... We just call it PIP.

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

Let's get started.

Want to watch the video tutorial instead?

Tutorial

Check the version you are using. If they are the same you can use either pip or pip3 as you wish.

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 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

Top comments (0)