What is the correct format to upgrade pip3 when the default pip is pip2?
Just use the pip3
command you already have:
pip3 install --upgrade pip
The installed project is called pip
, always. The pip3
command is tied to your Python 3 installation and is an alias for pip
, but the latter is shadowed by the pip
command in your Python 2 setup.
You can do it with the associated Python binary too; if it executable as python3
, then use that:
python3 -m pip install --upgrade pip
Again, the project is called pip
, and so is the module that is installed into your site-packages
directory, so stick to that name for the -m
command-line option and for the install
command.
When I searched for "how to update pip3" this came up. I had the problem described here in mind:
The Problem
Upgrading with pip3 might make point pip
to the Python 3 version.
It seems as if this is not the case (any more).
The solution
Update the one you want to keep after the one you want to upgrade. Hence
pip3 install --upgrade pippip2 install --upgrade pip --force-reinstall
will make sure that pip
points to pip2
.