0% found this document useful (0 votes)
141 views18 pages

Python, Install PIP

Download as pdf or txt
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 18

How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.

com/tag/install-pip-for-python/

HOME › PROGRAMMING

How to Install Python PIP on Windows, Mac, and


Linux
Many Python developers rely on a tool called PIP for Python to streamline development. Here's
how to install Python PIP.

BY ANTHONY GRANT
PUBLISHED JAN 21, 2020
  

1 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

Just like any serious programming language, Python supports third-party libraries and
frameworks that you can install to avoid reinventing the wheel with every new project. If
you want to use them you can find these Python libraries on a central repository called
the Python Package Index (PyPI.

Downloading, installing, and managing these packages by hand can be frustrating and
time-consuming. This is why many Python developers rely on a special tool called PIP for
Python (or Python PIP to make everything much easier and faster.

How to Install PIP for Python

What Is PIP for Python?


PIP is an acronym that stands for "PIP Installs Packages" or "Preferred Installer Program".
It's a command-line utility that allows you to install, reinstall, or uninstall PyPI packages
with a simple and straightforward command: pip.

If you've ever done any command-line work on Windows (with the Command Prompt) or
Mac or Linux (with the Terminal and Bash), then you can skip down to the installation
instructions for your particular operating system.

Is PIP Installed With Python?


2 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

If you're using Python 2.7.9 (or greater) or Python 3.4 (or greater), then PIP comes
installed with Python by default. If you're using an older version of Python, you'll need to
use the installation steps below. Otherwise, skip to the bottom to learn how to start using
PIP.

If you're running Python in a virtual environment created with either virtualenv or pyvenv,
then PIP will be available regardless of the Python version.

Is Python Correctly Installed?


You have to make sure Python is properly installed on your system. On Windows, open up
the Command Prompt using Windows key + X and selecting Command Prompt. On Mac,
open the Terminal using Command + Space and searching for terminal. On Linux, open
the Terminal using Ctrl + Alt + T. Linux shortcuts may vary by distribution.

Then type:

python --version

On Linux, Python 3.x users may need to use:

python3 --version

If you get a version number (e.g. "Python 2.7.5") then Python is ready to go.

If you get a "Python is not defined" message, then you'll have to first install Python
properly. That's beyond the scope of this article. The Python site has some detailed
instructions for installation.

How to Install PIP on Windows

3 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

These instructions should work on Windows 7, Windows 8.1, and Windows 10

 Download the get-pip.py installer script. If you're on Python 3.2, you'll need this
version of get-pip.py instead. Either way, right-click on the link and select Save As...
and save it to any safe location, such as your Downloads folder.
 Open the Command Prompt and navigate to the get-pip.py file.
 Run the following command: python get-pip.py

How to Install PIP on Mac


Modern Mac systems come with Python and PIP already installed. However, this version
of Python tends to be outdated and not the best choice for serious Python development.
It's highly recommended that you install a more current version of Python and PIP.

If you want to use the native system Python installation but don't have PIP available, you
can install PIP with the following command in Terminal:

sudo easy_install pip

If you'd rather install a more up-to-date version of Python, then you can use Homebrew.
Don't know what that is? Learn more about installing software with Homebrew on Mac.
These instructions will assume you already have Homebrew installed and ready to go.

Installing Python with Homebrew is done with a single command:

brew install python

This will install the latest version of Python, which should come packaged with PIP. If the
installation is successful but PIP is unavailable, you may need to re-link Python using the
following Terminal command:

4 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

How to Install PIP on Linux


If your Linux distribution came with Python already installed, you should be able to install
PIP using your system's package manager. This is preferable since system-installed
versions of Python do not play nicely with the get-pip.py script used on Windows and
Mac.

Advanced Package Tool (Python 2.x)

sudo apt-get install python-pip

Advanced Package Tool (Python 3.x)

sudo apt-get install python3-pip

pacman Package Manager (Python 2.x)

sudo pacman -S python2-pip

pacman Package Manager (Python 3.x)

sudo pacman -S python-pip

Yum Package Manager (Python 2.x)

sudo yum upgrade python-setuptools

5 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

sudo yum install python-pip python-wheel

Yum Package Manager (Python 3.x)

sudo yum install python3 python3-wheel

Dandified Yum (Python 2.x)

sudo dnf upgrade python-setuptools

sudo dnf install python-pip python-wheel

Dandified Yum (Python 3.x)

sudo dnf install python3 python3-wheel

Zypper Package Manager (Python 2.x)

sudo zypper install python-pip python-setuptools python-wheel

Zypper Package Manager (Python 3.x)

sudo zypper install python3-pip python3-setuptools python3-wheel

How to Install PIP on Raspberry Pi


As a Raspberry Pi user, you're probably running Raspbian since it's the official operating
system designated and provided by the Raspberry Pi Foundation. You're free to install

6 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

another operating system, such as Ubuntu. If that is the case you should look at the
Linux instructions.

Starting with Raspbian Jessie, PIP comes installed by default. It's one of the big reasons to
upgrade to Raspbian Jessie instead of sticking with Raspbian Wheezy or Raspbian Jessie
Lite. However, if you're on an older version of Raspbian, you can still install PIP.

On Python 2.x:

sudo apt-get install python-pip

On Python 3.x:

sudo apt-get install python3-pip

With Raspbian, Python 2.x users should use pip while Python 3.x users should use pip3
when issuing PIP commands.

How to Upgrade PIP for Python


While PIP itself doesn't update very often, it's still important to stay on top of new versions
because there may be important fixes to bugs, compatibility, and security holes.
Fortunately, upgrading PIP is quick and easy.

On Windows:

python -m pip install -U pip

On Mac, Linux, or Raspberry Pi:

pip install -U pip

7 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

On certain versions of Linux and Raspberry Pi, you may need to use pip3 instead.

How to Manage Python Packages With PIP


Once PIP is ready, you can start installing packages from PyPI

pip install package-name

To install a specific version of a package instead of the latest version:

pip install package-name==1.0.0

To search PyPI for a particular package:

pip search "query"

To see details about an installed package:

pip show package-name

To list all installed packages:

pip list

To list all outdated packages:

8 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

To upgrade an outdated package:

pip install package-name --upgrade

Note that older versions of a package are automatically removed by PIP when upgrading
to a newer version of that package.

To completely reinstall a package:

pip install package-name --upgrade --force-reinstall

To completely get rid of a package:

pip uninstall package-name

Learn More About Python


We recommend reading up on reasons why Python is useful today and how it is used in
some very high-paying software jobs. This can give you the motivation to keep learning
Python and push your skills to the next level.

If you're still a beginner, check out these these best websites to learn Python
programming or our guide on how to build a basic web crawler.

If you're more of an intermediate Python developer, consider sharpening your knowledge


with some real-world applications like building your own social media bot using Python.

  

9 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

15 Free Internet TV Channels You Can Watch Online


Here are the best internet TV channels to watch online, all of which are READ NEXT 
both free and legal.

RELATED TOPICS

PROGRAMMING PROGRAMMING PYTHON

ABOUT THE AUTHOR

Anthony Grant
41 Articles Published)

Anthony Grant is a freelance writer covering Programming and Software. He's a Computer Science major dabbling in
programming, Excel, software, and technology.

More From Anthony Grant 

SUBSCRIBE TO OUR NEWSLETTER


Join our newsletter for tech tips, reviews, free ebooks, and exclusive deals!

[email protected]

SUBMIT

ON THE WIRE

10 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

How to Use Goal Seek in Microsoft Excel for What-If Scenarios

The 8 Best Guitars for Beginners

11 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

Sony Is Unveiling a New Xperia Phone on April 14th

Your Phone Is Secretly Always Recording: How to Stop Google


From Listening

12 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

Rumor: Google Is Launching the Pixel Buds A Sometime in 2021

The 4 Best Pastebin Alternatives for Sharing Code and Text

READ NEXT

13 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

7 Ways to Get Command Line Help on Linux

Minisform U850 Mini-PC Review: NUC Killer With Outstanding


Value and Flexibility

14 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

The 5 Best Police Scanner Apps for Android

What Do You Actually Own If You Buy an NFT?

15 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

Why Amazon Is Openly Arguing With Politicians on Twitter

Is Disney+ Still Good Value for Money?

16 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

CPU Cooling Explained: Water Cooling vs. Air Cooling

What Is Malware and How Does It Work?

17 of 18 4/3/2021, 5:06 PM
How to Install Python PIP on Windows, Mac, and Linux https://www.makeuseof.com/tag/install-pip-for-python/

Facebook Bans Donald Trump… Again

Write For Us Home Contact Us Terms Privacy Copyright About Us Fact Checking Policy

Corrections Policy Ethics Policy Ownership Policy Partnership Disclaimer

Copyright © 2021 www.makeuseof.com

18 of 18 4/3/2021, 5:06 PM

You might also like