Atlantic.Net Blog

How to: Useful pip Commands

Brad Pitcher
by Atlantic.Net (2 posts) under Dedicated Server Hosting


A good knowledge of how to use the pip command to manage Python packages can make the difference between a jumbled mess of spaghetti code and a nicely organized codebase. This guide will teach you the basics of using pip effectively so you can spend more time writing, and less time wrangling code.



What is pip

pip is a package manager for the Python programming language. It provides access to a massive repository of open source tools and libraries, as well as the ability to manage your own proprietary packages. One of the greatest benefits to using a package manager is that it automatically installs the dependencies of any package you install, allowing you to more quickly get back to writing some code.



The good news is that pip is built into Python versions 2.7.9 or later in the 2.X series and 3.4 or later in the 3.X series. If you are using an older version of Python, you’ll need to upgrade to get pip natively. However, if that is not possible, it is easy to install by downloading the bootstrap script and running it from the command line like so:



Upgrading pip

Even if you have a modern version of Python with pip prepackaged, it may be out of date by the time you read the guide. Fortunately, it has the wonderfully useful ability to upgrade itself, like so:

pip install -U pip

or on Windows:

python -m pip install -U pip

The different upgrade command in Windows is necessary because in Windows it is not possible to overwrite a running executable. With this upgrade command, the running executable is actually python.exe, which makes pip.exe available to overwrite.


pip Commands

Now that you have pip, it’s time to start managing some packages! Simply enter pip into your shell to get a list of pip commands and an overview of the options available to you. Let’s walk through their usage.

pip search

The search command allows you to search through the database of packages in Python’s central package repository, PyPI. For example:

pip search django

This search will generate a list of the over 8,000 packages with the term “django” in either the name or the description of the package. The lookup is case-insensitive, so this search will return results matching “django” or “DJANGO” (or any other case variation, such as “Django” or even “djAngo”).

pip install

Arguably the most useful command provided by pip, the install command installs a Python package and its dependencies into your Python environment. The simplest usage is similar to search; just specify the name of the package you wish to install.

pip install Flask

The install command is also case-insensitive. You can also install a specific version of a package or a range of versions. One reason you might want to specify a range is if you require a package as a dependency to your own code, and you wish to indicate that your code will work with any version in that range.

pip install Flask==0.10.1
# install this particular version 

pip install "Flask>=0.9,<0.11"
# install versions matching the range from 0.9 up to (but not including) 0.11

You can also put a list of packages (one per line) in a text file and install all of them at once using the -r or --requirement flag.

pip install -r requirements.txt

The install command can also upgrade packages (as illustrated above in Upgrading pip) by including the -U or --upgrade option. Despite the --upgrade name, the option can be used anytime you need to change the version of an installed package, whether the new version is higher or lower than the installed version.

If the package you wish to install is not in the PyPI repository, then you can install from a version control system. For example:

pip install git+

pip uninstall

Of course, sometimes you need to remove packages. The uninstall command removes the specified package(s) from your environment.

pip uninstall Pyramid

pip freeze

If building a list of all the packages you need sounds like a lot of work, then the freeze command is for you. This command outputs all the currently installed python packages and their versions. You can also redirect this output to a text file to build a ready-made source to use with the install command.

pip freeze > requirements.txt


Learning more

We have barely scratched the surface of the feats you can accomplish with pip in this tutorial. The best way to learn more is to get out there and use pip to manage your Python project’s dependencies. For reference, you can find the complete pip documentation here.


Thank you for following along this how-to, we hoped you have enjoyed it. Please check back here for more updates or check out the many services offered by, including dedicated server hosting, Web Server Hosting and SQL Hosting.


Get A Free To Use Cloud VPS

Free Tier Includes:
G3.2GB Cloud VPS Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year

Looking for a Hosting Solution?

We Provide Cloud, Dedicated, & Colocation.

  • Seven Global Data Center Locations.
  • Flexible Private, Public, & Hybrid Hosting.
  • 24x7x365 Security, Support, & Monitoring.
Contact Us Now! Med Tech Award FTC
SOC Audit HIPAA Audit HITECH Audit

Recent Posts

Best Cloud Consultancy or MSP in 2022
BAA Red Flags: What Should Your HIPAA-Compliant Hosting Company Be Willing to Accommodate?
HIPAA Compliance for Remote Workers: How to Maintain HIPAA Compliance with a Remote Team
How to Make the Best Use of the Cloud in the Internet of Things (IoT)
How to Make the Best Use of Artificial Intelligence in Cloud Computing

Get started with 12 months of free cloud VPS hosting

Free Tier includes:
G3.2GB Cloud VPS Server Free to Use for One Year
50 GB of Block Storage Free to Use for One Year
50 GB of Snapshots Free to Use for One Year

New York, NY

100 Delawanna Ave, Suite 1

Clifton, NJ 07014

United States

San Francisco, CA

2820 Northwestern Pkwy,

Santa Clara, CA 95051

United States

Dallas, TX

2008 Lookout Dr,

Garland, Texas 75044

United States

Ashburn, VA

1807 Michael Faraday Ct,

Reston, VA 20190

United States

Orlando, FL

440 W Kennedy Blvd, Suite 3

Orlando, FL 32810

United States

Toronto, Canada

20 Pullman Ct, Scarborough,

Ontario M1X 1E4


London, UK

14 Liverpool Road, Slough,

Berkshire SL1 4QZ

United Kingdom