In this article, I’ll quickly guide you through the installation steps for Python’s package installer
pip. But first things first: 👇
What Is Pip?
pip is the package installer for Python used to install and manage software packages (also known as libraries or modules) written in Python.
pip makes it easy to install, upgrade, and uninstall packages in your Python environment.
When you install a package with
pip, it automatically downloads and installs any dependencies required by the package, making it very convenient for managing your Python projects. You can use
pip from the command line but it also integrates with popular development environments like Jupyter, PyCharm, and Visual Studio Code.
Is Pip Already Included in Python?
pip is included with Python distributions from version 3.4 onwards, so if you have a recent version of Python installed, you should already have
✅ Recommended: How to Check Your Python Version?
If you don’t have
pip installed, you can easily install it using the steps outlined as follows:
5 Steps to Install Pip Easily
pip in Python, follow these steps:
- Check if
pipis already installed by running the command “
pip -V” in your command prompt or terminal. If you see a version number,
pipis already installed. If not, proceed to step 2.
- Download the
get-pip.pyscript from the official Python website (see below).
- Open a command prompt or terminal and navigate to the directory where you downloaded the
- Run the command
python get-pip.pyto install
- Verify that
pipis installed by running the command
That’s it! You should now have
pip installed and ready to use in your Python environment.
In case you weren’t able to complete step 2, here’s how to do it quickly:
How to Download get-pip.py from Official Python?
To download the get-pip.py script from the official Python website, follow these steps:
- Open a web browser and go to the following URL: https://bootstrap.pypa.io/get-pip.py
- Right-click on the page and select “Save As” (or similar option) to download the file.
- Choose a directory to save the file to and click “Save”.
- Once the download is complete, navigate to the directory where you saved the file.
Alternatively, you can use the following command in your command prompt or terminal to download the file directly:
curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py
This will download the get-pip.py file to your current working directory.
Are There Other Ways to Install Pip?
Yes, there are a few other ways to install
pip depending on your operating system and Python distribution.
Here are the three most common methods:
- Package managers: Many Linux distributions include
pipin their package repositories, which means you can use your distribution’s package manager to install it. For example, on Ubuntu, you can use the following command:
sudo apt-get install python-pip.
- Python installers: Some Python distributions come with
pippre-installed, such as Anaconda and ActivePython. If you are using one of these distributions, you should already have
- Python package installer: Another way to install
pipis by using the
ensurepipmodule, which is included with Python since version 3.4. You can use the following command:
python -m ensurepip --default-pip.
Regardless of the method you choose, it’s always a good idea to verify that
pip is installed and working correctly by running the command
How to Upgrade Pip?
To upgrade pip to the latest version, follow these steps:
Step 1: Open a command prompt or terminal and enter the following command to upgrade
python -m pip install --upgrade pip
The previous command was for Linux or macOS. For Windows, you may want to use:
py -m pip install --upgrade pip
Step 2: Depending on your system configuration, you may need to run this command with administrator privileges. On Linux or macOS, you can use
sudo to run the command as root, like this:
sudo python -m pip install --upgrade pip
pip will download and install the latest version of itself. Once the upgrade is complete, you can verify that
pip is up to date by running the command:
This will display the version number of the newly installed pip.
That’s it! You should now have the latest version of
pip installed on your system.
Note that it’s a good idea to keep
pip up to date to take advantage of bug fixes, security updates, and new features. You can check for updates to individual packages installed with pip using the
pip list --outdated command, and upgrade them with
pip install --upgrade <package>.
✅ Recommended: Pip Commands — The Ultimate Guide
While working as a researcher in distributed systems, Dr. Christian Mayer found his love for teaching computer science students.
To help students reach higher levels of Python success, he founded the programming education website Finxter.com that has taught exponential skills to millions of coders worldwide. He’s the author of the best-selling programming books Python One-Liners (NoStarch 2020), The Art of Clean Code (NoStarch 2022), and The Book of Dash (NoStarch 2022). Chris also coauthored the Coffee Break Python series of self-published books. He’s a computer science enthusiast, freelancer, and owner of one of the top 10 largest Python blogs worldwide.
His passions are writing, reading, and coding. But his greatest passion is to serve aspiring coders through Finxter and help them to boost their skills. You can join his free email academy here.