×

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

tell() function in Python

Introduction The tell() function in Python is used to return the current position of the file read/write pointer within the file. An integer value is returned by this method, and it...

2 minutes read.

Python ltrim() function

Python ltrim() function The ltrim() function in PHP removes whitespace or other predefined characters from the beginning or left side of a string. The related functions are as follows: rtrim() – This function is used to...

1 minute read.

File Explorer using Tkinter in Python

File Explorer: Users can control folders and files on a device using an application known as a file manager or file explorer. Customers can access, edit, copy, delete, and start moving files...

3 minutes read.

Compound Interest GUI Calculator using PyQt5 in Python

GUI: One of the most significant factors that increased the usability of computer and digital technologies for common, less tech-savvy users is likely the development and widespread adoption of GUIs. GUIs...

6 minutes read.

Ternary operators in python

Starting from Python version 2.5, ternary operators are also known as Conditional operators. Using these operators, we can evaluate any problem based on a condition. It is an alternative and...

4 minutes read.

How to Convert A List into String In Python?

How to Convert A List into String In Python? List is a data structure in Python that can hold values of different data types. The values are enclosed in square brackets...

3 minutes read.

Find Last Occurrence of Substring using Python

Introduction When planning to work with strings, we may need to determine whether a substring is present. This issue is rather typical, and there have been numerous discussions about how to...

3 minutes read.

Kite Python

Kite in Python: The Kite is a package provided by the python programming language; it works with the help of artificial intelligence and helps us write code inside the visual studio....

3 minutes read.

Python Project Ideas

One of the most widely used programming languages today is Python. This pattern appears set to continue through 2023 and beyond. Therefore, working on some current Python project ideas is the...

10 minutes read.

What is a Script in Python

Have you ever heard that Python is a scripting language? Or when people address a Python program file as a script? Besides programming, script generally means "a written story for...

3 minutes read.

Excel Automation with Python

Data analysis is the upcoming technology in the IT sector; this data analysis can be performed easily with the help of data frames or by using excel sheets. The data...

4 minutes read.

GUI to Shut down, Restart and Logout from the PC using Tkinter in Python

GUI: One of the most significant factors that increased the usability of computer and digital technologies for common, less tech-savvy users is likely the development and widespread adoption of GUIs. GUIs...

4 minutes read.

How to make API calls in Python

Information is extremely critical these days since it drives applications and organizations. It is subsequently critical to figure out how to get this information to serve your application. In fundamental...

4 minutes read.

Difference between Mutable and Immutable Objects

Difference between Mutable and Immutable Objects As we all know that Python is an object-oriented programming language. Object-oriented programming approach is based on the objects and the classes’ stores the data...

4 minutes read.

How to create a list in Python?

How to create a list in python Python is known for its versatility and its data structures help us to perform different kinds of operations on various datasets irrespective of their...

4 minutes read.

Python Dictionary popitem() method

Python Dictionary popitem() method The dictionary.popitem() method in Python removes the item that was last inserted into the dictionary. Syntax dictionary.popitem() Parameter NA Return This method returns an arbitrary element (key, value) pair from the given dictionary...

1 minute read.

Removing the First Character from the String in Python

String The string is the collection of characters. The strings in python are “immutable”; we cannot change a string once they are created. In python, whatever data we take as input...

4 minutes read.

any() Keyword in python

“any” keyword in python This page contains all the information about any () Keyword in python, how it is used with lists, tuples, dictionaries, sets, and what its function is? Python...

3 minutes read.

Weight Conversion GUI using Tkinter in Python

GUI: One of the most significant factors that increased the usability of computer and digital technologies for common, less tech-savvy users is likely the development and widespread adoption of GUIs. GUIs...

3 minutes read.

Flutter Python

The flutter is a frame work available in the python programming language, to create web applications, mobile apps. The flutter is generally used for the development of the backend of...

3 minutes read.