PDF download Download Article
Keep your Python environment up-to-date with this simple guide
PDF download Download Article

If you haven't updated Pip, the Python package manager, in a while, you might be using an outdated version. The easiest way to update Pip is to do so from within Python. If you also need to upgrade Python, installing the latest version of Python will also get the most up-to-date version of Pip. Whether you use Terminal/Command Prompt commands, the Python installer, or a package manager, it's easy to update Pip on Windows, macOS, and Linux. We'll show you how, plus give you helpful troubleshooting tips along the way.

Things You Should Know

  • If you're using Python 3.4 or later, you can update Pip using the command python -m pip install --upgrade pip .
  • To check your Pip version, use pip3 -V (Python 3) or pip2 -V (Python 2).
  • If you want to update Python in addition to Pip, you can do so by downloading the installer, using Homebrew, or your Linux distribution's package manager.
Method 1
Method 1 of 5:

Updating from Python

PDF download Download Article
  1. The most straightforward way to update Pip is from the command line. Because Python 3.4 and later comes with Pip, you can easily update it without downloading a new package. [1]
    • Mac: Type Terminal into Spotlight search and select Terminal .
    • Linux: Press Ctrl + Alt + T or click Terminal in your app list.
    • Windows: Type command prompt into the Windows search bar and click Command Prompt .
  2. Run the command pip -V to see which version of Pip is installed. This command will print the version number to the terminal.
    • If you have both Python 2 and Python 3 installed, the pip command may evoke Python 2 instead of the latest version. Use pip3 -V to check the version of Pip for Python 3, and pip2 -V to check for Python 2.
    • If you're using Python 3.4 or earlier, Pip may not be installed. In this case, use python -m ensurepip --upgrade to install it now.
    • If you're using Windows and get the error "pip is not recognized as an internal or external command," make sure you've installed Python . If you have installed Python and get this error, you'll need to add Python to your Windows path and then relaunch Command Prompt. To learn how, see Adding the Python Path to Windows .
    Advertisement
  3. If this command doesn't work on Windows, use py -m pip install --upgrade pip instead.
    • If you get permissions errors in Linux, run sudo python -m pip install --upgrade pip .
    • If you have both Python 2 and Python 3, update Pip for each version separately:
      • python3 -m pip install --upgrade pip
      • python2 -m pip install --upgrade pip
  4. Advertisement
Method 2
Method 2 of 5:

Using the PIP Install Script

PDF download Download Article
  1. If you're using a version of Python 3 older than Python 3.4, you can use a script to install the latest version of Pip. This method will not work for deprecated versions of Python, including Python 2. [2]
    • Mac: Type Terminal into Spotlight search and select Terminal .
    • Linux: Press Ctrl + Alt + T or click Terminal in your app list.
    • Windows: Type command prompt into the Windows search bar and click Command Prompt .
  2. You can do this easily using curl on any operating system, as it's preinstalled. Just run the command curl https://bootstrap.pypa.io/get-pip.py -o get-pip.py at the prompt and wait for the script to download. [3]
  3. To do so, run the downloaded script using the command python3 get-pip.py . This installs the latest version of Pip for Python 3.
  4. In the Terminal or Command Prompt window, run the command pip3 -v
  5. Advertisement
Method 3
Method 3 of 5:

Downloading the Installer (Windows & Mac)

PDF download Download Article
  1. If you want to update both Python and Pip, you can download and install the latest version of Python. Before you do this, make sure you're not already using the latest version. To check, open Command Prompt or Terminal and run python --version .
    • Only use this method if you want to update Python as well as Pip. If Python is already up to date on your PC or Mac, update pip via Python instead.
    • If the version number starts with 2 instead of 3, run python3 --version to see if Python 3 is also installed and find the version number.
  2. Find the latest version at https://www.python.org/downloads . Compare your version of Python to the version in the yellow "Download Python" button at the top of the page.
  3. If you're using an older Python version than the latest release, click the yellow Download button to download the latest installer.
  4. Double-click the downloaded file and follow the on-screen instructions to install. Once Python is installed, you'll have the latest version of Pip.
    • On Windows, make sure to check the box next to "Add python.exe to PATH" at the bottom of the installer to ensure you can run Python and Pip commands from any location.
  5. In a new Command Prompt or Terminal window, run the command pip -v to check the Pip version.
    • If you have both Python 2 and Python 3, run pip3 -v to check the Pip version of Python 3.
  6. Advertisement
Method 4
Method 4 of 5:

Using a Linux Package Manager

PDF download Download Article
  1. You can do so on most Linux distributions by pressing Ctrl + Alt + T .
    • Use this method if you want to update both Python and Pip at the same time.
  2. If you're already using the latest version of Python, there's no need to use this method. Run the command python3 --version to check. Then, compare your version to the latest stable release at https://www.python.org/downloads .
    • Ubuntu and Debian: sudo apt update
    • CentOS, Fedora, Redhat: sudo dnf upgrade
  3. Once you run the command to install the latest version of Python 3, Pip will also be upgraded.
    • Ubuntu and Debian: sudo apt install python3
    • CentOS, Fedora, Redhat: sudo dnf install python3 .
  4. Advertisement
Method 5
Method 5 of 5:

Using Homebrew (Mac)

PDF download Download Article
  1. You can update both Python and Pip using Homebrew if you prefer. You should only use this method if you need to upgrade Python as well as Pip.
    • Before you continue, make sure Homebrew is installed. To check, type brew -v and press Return . If the command is not found, you'll need to install Homebrew using this command: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" [4]
    • To check your Python version, run the command python3 --version . Compare your version to the latest stable release available from https://www.python.org/downloads/macos .
    • If the command is not found, Python 3 is not installed. Continue with this method to install it.
  2. This command installs a library that can help you manage your Python versions.
  3. To make sure you're getting the latest version of Python (and the latest version of pip), you can run this command to find the most recent version number.
  4. For example, to install Python 3.11.5, you'd type pyenv install 3.11.5 and press Return . This installs the latest version of Python 3 and pip. [5]
    • Now that you have the latest pip version, you can update it in the future using the command python3 -m pip install --upgrade pip .
  5. Advertisement

Expert Q&A

Ask a Question
      Advertisement

      Video

      Tips

      • If you're using Linux, avoid using sudo to install Python packages. If you install a package that contains malicious code with root permissions, you risk giving the attacker unrestricted access to your system. [6]
      Submit a Tip
      All tip submissions are carefully reviewed before being published
      Name
      Please provide your name and last initial
      Thanks for submitting a tip for review!
      Advertisement

      About This Article

      Thanks to all authors for creating a page that has been read 133,542 times.

      Is this article up to date?

      Advertisement