×

How to upgrade PIP in python

We use the PIP command in our command prompt to install any package. PIP is used to install published Python packages in the PyPI (Python package index) or other indices. Generally, it installs packages that are not already installed via standard Python distribution.

Upgrading or updating PIP to its latest version is as simple as installing packages. This article will discuss upgrading and downgrading PIP in Windows, MAC, and Linux operating systems.

In WINDOWS:

Steps to update the PIP version in Windows:

1. Open the command prompt from the search menu.

How to Upgrade PIP in Python

2. Check your current PIP version by using the command:

pip –version

3. Type the command:

Python –m pip install –upgrade pip

4. It will display a successful message.

5. You can check the version again to see the update.

Note: If you get an error that says:

> ‘pip’ is not recognized as an internal

> or external command, operable program, or batch file

You need to add Python into the path first before updating PIP. It occurs because the OS cannot find Python in the path.

  • If you want to either update or downgrade your PIP to a specific version, then you need to specify the version:
> Python –m pi install pip==version number

In Anaconda:

If we need to upgrade pip using the conda package manager in the Conda environment, then we can do that either by using the anaconda prompt or the anaconda navigator.

  • By using the anaconda prompt:
    1. Open Anaconda Prompt. You can find it by searching the anaconda prompt in the search menu.
    2. Enter the command:

conda update pip

  • By using the Anaconda navigator:

1. Open the anaconda navigator by searching in the search menu.

2. In the list of Python packages, find pip either by scrolling or by searching for pip.

How to Upgrade PIP in Python

3. Click on the green checkbox, and in the options displayed, click "mark for update". The green box turns sky-blue.

4. Click Apply on the right-bottom to upgrade pip.

How to Upgrade PIP in Python

In MAC OS:

1. Open Terminal

2. Check your current pip version to see if there is a newer version to update using the command:

$ pip --version 
  • If there is a newer version available to update, enter the command:
$ pip install --upgrade pip

Note: If you run into the "pip command not found" error, use the command:

$ Python –m pip install --upgrade pip
  • If you want to upgrade or downgrade pip to a specific version, you need to mention the version in the command:
$ pip install --upgrade pip==version number
  • All these commands work the same for pip3 too. You can also replace pip with pip3 if you want:
$ pip3 install --upgrade pip
$ ip3 install --upgrade pip==version number

In LINUX OS

1. Open Terminal

2. Check your current pip version to see if there is a newer version to update using the command:

$ pip --version 

3. If there is a newer version available to update, enter the command:

$ pip install --U pip

Or

$ pip install --upgrade pip

Your pip gets updated to the latest version. You can check the version by using the above command to see the change.

If you get into any errors like permission issues, then use the following commands instead:

$ sudo –H pip3 install --upgrade pip (for pip3)
$ sudo –H pip2 install --upgrade pip (for pip2)

Sudo is the command that is used to access restricted files. For security purposes, you might be needed to type your password when you use sudo in a command.


Related Topics

Python pow() Function

Python pow() Function The pow() function in Python return the parameter ‘x’ to the power ‘y’ and if the parameter ‘z’ is present, it returns x to the power y, modulo z (computed more efficiently than pow(x, y) % z). Syntax pow(x, y[, z]) Parameter x: This parameter represents the base...

1 minute read.

Subprocess Module in Python

What is a Process? Every program will have its respective system state, i.e., the state in which it is running. A program that is in a running state or in a...

7 minutes read.

Python EOL (End Of Line)

Introduction An EOL (End Of Line) is defined as a syntax error that indicates that the Python interpreter reached at the end of the line when it tried to scan a...

3 minutes read.

How To Install Python In Ubuntu

How To Install Python In Ubuntu Ubuntu is free and open-source software and it is an essential part of the Linux distribution. It is a popular operating system developed by Canonical. If we...

3 minutes read.

How to Sort a String in Python?

The characters in the string are sorted or put in alphabetical order using the sort string function in Python. Python has built-in techniques for sorting strings available. Since we occasionally...

6 minutes read.

Iterate a Dictionary in Python

In this tutorial, we will learn how to Iterate a Dictionary in Python. Dictionary: In Python, a dictionary is an unordered collection of data values that is used to store data values,...

3 minutes read.

Python program to count the number of a substring in a string

Python program to count the number of a substring in a string A part of the string is called a substring. This article explains the Python program to find how many...

1 minute read.

What is Python 2

Python is a widely used high-level language. The initial work on developing python was begun in the late 1980s. In 1989, Guido Van Rossum started to work on it. Initially,...

3 minutes read.

Python Win32 Process

The Win32 process is essentially a Python procedure. This program provides access to advanced Win32 process creation and management features. Process objects are created through the Create method (the constructor)....

6 minutes read.

Python Set symmetric_difference() method

Python Set symmetric_difference() method The set.symmetric_difference() method returns a new set, which is the symmetric difference of two sets. The returned set contains only the unique items and, hence, deleting the common elements of...

2 minutes read.

Python Constructor

Introduction A constructor is defined as the special kind of function or method that is used for instance variables initialization during the creation of an object of a class. The constructor's task...

5 minutes read.

Fsolve in Python

Python Programming Language Python programming language is one of the most used programming languages, as it is used widely in the field of software and data analysis, web development, etc. It...

3 minutes read.

Python List sort() method

The list.sort () method in Python sorts the items of the list in place. Syntax list.sort(key=None, reverse=False) Parameter reverse: If a Boolean value ‘True’ is passed, the  sorting will be done in the descending order else for ‘False’...

2 minutes read.

Create First GUI Application using Tkinter in Python

GUI: A graphical interface (GUI) is a user interface that lets users interact with electronic devices like computers and smartphones by using menus, icons, and other visual cues (graphics). In contrast...

6 minutes read.

Python pycountry

What is Pycountry? Python programming language: Python is an interactive and more accessible language than any other programming language. The python programming language uses a variety of libraries to perform the operations...

4 minutes read.

Python program to perform the arithmetic operation

Python program to perform the arithmetic operation This program will write a code to perform some basic arithmetic operations like addition, subtraction, multiplication, exponent, modulus, and division. Here we first need...

2 minutes read.

Python System Requirements

Introduction As we know, Python is a popular programming language usually used to write scripts for operating systems. It’s handy adequate for utilizing in web development and application design. In this article,...

2 minutes read.

Count Number of Keys in Dictionary Python

Dictionary is a particular data type in python. Dictionary stores unique values by taking different keys and their assigned values. Through this article, we will learn about python dictionary count,...

3 minutes read.

Python List index() method

Python List index() method The list.index () method in Python returns the position at the first occurrence of the specified value. Syntax list.index(x[, start[, end]]) Parameter element – This parameter represents the element whose lowest index will be returned. start (Optional)...

2 minutes read.

How to plot multiple linear regression in Python

This article lets us look into linear regression in Python and how we can plot multiple linear regressions in it. Linear regression One of the simplest and most widely used Machine Learning...

4 minutes read.