7 Python Pip Command Examples

Table of Contents

Pip is the package installer for Python. We can use pip to install packages that are not distributed as part of the standard library from the Python Package Index and other indexes.

  • How to install Pip on Linux?
  • How to install & remove a python package with Pip
  • Install a python package with a specific version
  • Install a python package from a specific repo

How to install Pip on Linux?

First, we need to download pip installer – wget or curl -o

Second, we need to run the following command in the folder where you have downloaded python

If some certificate issue comes then use:
wget –no-check-certificate

Go to download dir and run the command:  python

Install a package from PyPI (default python index)

$ pip install SomePackage
Successfully installed SomePackage

Show what files were installed

$ pip show –files SomePackage
Name: SomePackage Version: 1.0 Location: /my/env/lib/pythonx.x/site-packages Files: ../somepackage/ […]

List what packages are outdated with pip

$ pip list –outdated
SomePackage (Current: 1.0 Latest: 2.0)

Upgrade a package with pip

$ pip install –upgrade SomePackage
[…] Found existing installation: SomePackage 1.0

Uninstall a package with pip

$ pip uninstall SomePackage
Uninstalling SomePackage:
/my/env/lib/pythonx.x/site-packages/somepackage Proceed (y/n)? y
Successfully uninstalled SomePackage

Install a python package with specific version

  • $ pip install SomePackage # latest version
  • $ pip install SomePackage==1.0.4 # specific version
  • $ pip install SomePackage>=1.0.4′ # minimum version

Install a python package from a specific repo with pip

Install from specific repo

  • $ pip install scrapy -i
  • -i, –index-url default is ( This should point to a repository

Linux Troubleshooting Guide:

Linux Learning Guide: is dedicated to providing comprehensive information on using Linux.

We hope you find our site helpful and informative.

Learn More


RHCSA Practice Exam

RHCSA Practice Exam A General Notes Here are some tips to ensure your exam starts with a clean environment: You do not need external servers

Read More »