I keep getting a message to upgrade pip

The issue seems to be that new virtual environments are using an old version of pip. Note that pip is installed from a source tarfile (or wheel) included with virtualenv, in the site-packages/virtualenv_support directory.

$ ls -l /path/to/site-packages/virtualenv_support
pip-9.1-py2.py3-none-any.whl

A quick way to workaround the problem is to make sure you upgrade pip whenever you create a new virtualenv, like so:

$ virtualenv venv
$ venv/bin/pip install -U pip

Alternatively, make sure you have the latest version of virtualenv. According to their release notes, virtualenv==16 is using pip==10.

$ pip install -U virtualenv

Finally, since virtualenv looks for pip*.whl in virtualenv_support, this will also work:

$ mv /path/to/site-packages/virtualenv_support/pip*.whl{,bak}
$ pip wheel -w /path/to/site-packages/virtualenv_support/ 'pip==18'

All new virtualenvs will use the version of pip that you installed into virtualenv_support. However, this feels hacky.

(Attempted with virtualenv==16. This results in all new virtualenvs with pip==18.)


Update pip from a bat file:

call .\venv\Scripts\activate
py -m pip install --upgrade pip
call deactivate

Or if you are in VS Code integrated Terminal

& venv/Scripts/activate.ps1
py -m pip install --upgrade pip

For me looks like you have multiple python environments and in one of them, there is not an upgraded pip. You have 2 options:

  • navigate to each of that folders and update each pip
  • you can remove all of them, reinstall and use virtualenv in future with correct pip
  • install some IDE (e.g. PyCharm) that can handle that automatically for you and show all issues visually