Search code examples
pippipenv

Why doesn't "pip install --upgrade pipenv" upgrade pipenv?


I am trying to update pipenv on mac. I followed Why can't I update pipenv to latest version? :

pip install --upgrade pipenv

It executes without errors (I get multiple Requirement already satisfied). Then I ran:

$ pipenv --version
pipenv, version 2020.6.2

According to https://pypi.org/project/pipenv/ I should get version 2023.2.18

Why isn't pipenv updating?


Solution

  • I had the same problem on mac.

    pipenv --version command refers to /usr/local/bin but you upgraded pipenv on a location like /Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/site-packages. The second location is invoked with pip show pipenv. The first location can also be displayed with which pipenv.

    After you upgrade the package, go to the /usr/local/bin and remove the pipenv link from there. Because it is a symlink referring to the location /usr/local/Cellar/pipenv/2022.9.8/bin/pipenv. In this Cellar directory, pipenv is an executable of version 2022.9.8.

    This is what I did. When you run pipenv --version in the command line, you should get the latest version. And virtual environments can be created as before.

    There could be other solutions but this one worked for me.