In this tutorial, we will learn how to upgrade pip, which is a useful skill to keep our Python environment up to date!
Table of Contents
- Outline
- How to Check Pip Version
- How to Upgrade pip Using pip
- 3 Steps to Upgrade Pip using Pip
- How to Update Pip using Conda
- How to Upgrade Pip Using Anaconda Navigator: 5 Steps
- Conclusion
- FAQ: Upgrading Pip
Outline
In the first section, we will learn how to check the pip version and upgrade pip using pip itself. The post will also provide a step-by-step guide to upgrading pip using pip, with more details. We will cover three simple steps: opening the command prompt, right-clicking on the Command Prompt app, and upgrading pip.
In the third section, we will use the package manager from Anaconda Python Distribution. Here we will learn how to update pip using conda. This section will walk you through the two-step process of opening Anaconda Prompt and updating pip.
In the final section, we will continue looking at how to upgrade pip using Anaconda. In fact, in this five-step process, we will learn how to open Anaconda Navigator. By the end of this blog post, you know the tricks of how to check and upgrade pip using these different methods.
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:
pip install --upgrade pip
Code language: Bash (bash)
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.
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
Here is 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 start up your favorite window manager instead. However, the next steps for upgrading pip are 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 will avoid any permission issues.
If you are using Linux you don’t have to right-click on the terminal window: open it up and go to step 3).
Step 3: Upgrade pip
Now, that the command prompt started and running we are ready to update pip. In this example, we are going to upgrade pip using pip:
pip install --upgrade pip
Code language: Bash (bash)
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 using the package manager conda.
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.
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 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. 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.
Conclusion
In this post, we have learned how to check and upgrade pip, a package manager for Python programming language. We have also covered frequently asked questions related to upgrading pip, and how to upgrade pip using different tools like Anaconda and command prompt.
First, we had a look at how to check the pip version on your system, which is crucial to ensure that you have the latest version of pip installed. Next, we learned how to upgrade pip using pip, which is the easiest way to upgrade pip to the latest version.
Then, we learned how to upgrade pip using different tools like Anaconda and command prompt. We provided a step-by-step guide for upgrading pip using pip, and how to upgrade pip using Conda and Anaconda Navigator. These tools provide users with a hassle-free way to upgrade pip and keep their Python environment up-to-date.
I hope that this post has been informative and helpful to you. Please share this post with your friends and colleagues who might benefit from learning how to upgrade pip. Keep exploring and happy coding!
FAQ: Upgrading Pip
1) Search for the Anaconda Prompt.
Type “Anaconda Prompt” in the search box, down to the left in Windows 10.
2) Open the Anaconda Prompt.
Second, we will 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
.
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.
Hey Erik! Thanks for your excellent guide. I got the message that I am using pip version x.x.x and that there is a a newer version available . Thus, I needed to find out how to run pip upgrade to get the newer version. Thanks for the post!