In this tutorial, we will learn how to upgrade pip. This may be handy, if we, for instance, are working with old Python environments, This, in turn, may lead to that we need to upgrade to the latest version.
In this post, we will learn how to get the latest version of pip using the three methods. First, we will use pip itself, second, we will use conda, and third, we will use the graphical user interface Anaconda navigator. Moreover, in the first subsections, we are going to use Windows Command Prompt as well as pip. Of course, we could also use Windows PowerShell to run the commands we need to upgrade pip. Find out how to open the command prompt here.
How to Check Pip Version
First, before learning how to upgrade pip we are going to answer the question “what version of pip do I have?” Now, to get the output, as in the image above, we can start up the Windows Command Prompt and type
pip --version. In the Python environment, we have pip 19.2.3 installed. Note, later in this post a step-by-step guide will show how to open Windows Command prompt.
How to Upgrade pip Using pip
Now, we are going to answer the question “how to update Python pip?” and we are going to start by using pip to update pip. To upgrade pip, we open up the command prompt and type the following code:
Code language: Bash (bash)
pip install --upgrade pip
If we now type
pip --version again we will see that we have the latest version of pip installed:
In this section, you learned how to get a newer version of pip. This method is very similar to updating or installing any Python package using pip. Later in this post, you will learn more details e.g. how to open the command prompt. First, however, you will get some quick answers to two questions.
FAQ: Upgrading Pip
Now before we continue to getting into the details of updating pip using pip, conda, and Anaconda manager we will answer two questions that may have brought you here.
How do I upgrade PIP on Anaconda?
1) Search for the Anaconda Prompt.
First, before running conda to update pip we are going to start the Anaconda Prompt. Type “Anaconda Prompt” in the search box, down to the left in Windows 10.
2) Open the Anaconda Prompt.
Second, we are going to click on the icon for the Anaconda Prompt and run it as administrator (right-click).
3) Upgrade pip!
Finally, we can update pip using conda. Now, this is very simple; all we need to do is write the following command to update pip:
conda upgrade -c anaconda pip.
How do you update PIP?
If we want to update pip, we can do so either by using pip, conda package manager, or Anaconda. For instance, if you want to use conda to upgrade pip this is how to do it:
conda update pip. You can, of course, also use pip itself.
Note that, you can also use pip to install a specific version of a Python package, if you need to.
3 Steps to Upgrade Pip using Pip
Now, here’s a more detailed description of how to upgrade pip using pip. In the first step, we are going to open up the command prompt:
Step 1: Open the command prompt
In the search box, to the bottom left, type “Command Prompt”.
Note, if you are using Linux you should, of course, start up your favorite window manager instead. However, the next steps for upgrading pip are basically the same anyway.
Step 2: Right-click on the Command Prompt app
The next thing we are going to do is to click on the command prompt app. We make sure to right-click on it and run it as administrator. This way we’ll avoid any permission issues.
Obviously, if you are using linux you don’t have to right-click on the terminal window: just open it up and go to step 3).
Step 3: Upgrade pip
Now, that we the command prompt up and running we are ready to update pip. In this example, we are going to upgrade pip using pip:
Code language: Bash (bash)
pip install --upgrade pip
That was it, now you should have upgraded pip to the latest version. In the next section, you will learn how to do the same procedure but using the package manager conda.
That was it, now we know how to upgrade pip without using pip! It was easy. Note, if your Anaconda Python distribution is in the system path, we could also have updated pip by opening the Windows Command Prompt and using the same commands as above.
How to Update Pip using Conda
In this section, we are going to learn how to upgrade pip using conda package manager. This may come in handy as many of us have installed Python using the scientific Python distribution Anaconda. That is, here we find the answer to the question “How do I upgrade PIP on Anaconda prompt?” Now, we are going to update pip by using three simple steps.
Step 1: Open Anaconda Prompt
First, we need to start up the Anaconda prompt. You can do this by clicking on the “Type here to search” field down to the left on Windows 10. In this field, you type “Anaconda prompt” and then you click on the top result (see image below).
Step 2: Update Pip
In this step, you are simply going to type
conda update pip in the Anaconda Prompt.
How to Upgrade Pip Using Anaconda Navigator: 5 Steps
In this final section, we are going to learn how to update pip using Anaconda Navigator. Using this method to upgrade pip is good if we don’t want to use the command prompt but rather use a GUI.
Step 1: Open Anaconda Navigator
First, we start up the Anaconda Navigator. It can be done by typing “Anaconda Navigator” in the search box, in the lower-left corner (see the examples above). We just need to click on “Environments” on the left part of Anaconda Navigator.
Step 3: Find Pip
In the second step, we scroll down to find pip in the list of Python packages:
Step 3: Choose Pip
Third, when we have found pip we click on the green check-mark as we can see that there is an update available for pip:
Step 4: Mark for Update
Fourth, after we have clicked on the green mark we will get a drop-down menu. Obviously, as we are going to upgrade pip we will choose “Mark for update”:
Step 5: Click Apply to Upgrade Pip
Finally, we are ready to update pip using Anaconda Navigator. In the bottom right corner, there will now be to buttons. We are going to press the green button with the text “Apply”:
Voila! The package pip, or any other Python package, should now be upgraded to the latest version! Updating pip using Anaconda Navigator was quite easy as well.
Many times we need to upgrade Python packages and this can, of course, be done using both pip and conda. Check out the recent post about upgrading Python packages.
In this post, we have learned how to upgrade pip to the latest version. The examples, on how to update Pip, were conducted under Windows 10. However, as pip (and conda) has the same functionality on Linux machines we could probably use them as well (e.g., using the sudo command). In conclusion, we have learned how to update pip using pip, using conda (i.e., Anaconda Prompt), and Anaconda Navigator.