I am running Debian bullseye/sid and recently updated to Debian unstable to experiment with the Sway windows manager. This went fine until I updated to a more recent version of python. My python3 is currently version 3.7.4.

Since updating, I can no longer import pipenv or pip and some other global packages are missing.

$ pipenv shell
Traceback (most recent call last):
  File "/home/user/.local/bin/pipenv", line 6, in <module>
    from pipenv import cli
ModuleNotFoundError: No module named 'pipenv'

In /usr/bin I have python2.7, python3.5, and python3.7. Pip is installed: "which pip" reads "/usr/bin/pip". I installed pipenv as a user installation (pip install --user pipenv). The binary is present.

Can anbody give me pointers on how best to investigate this problem?

edit: hm, in addition to updating, I also changed the default python version:

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 10

This is not advised, and, since I almost invariably work in venvs, would have made little difference to me even if it were so problematic. Before holidays I do dumb stuff ¯\_(ツ)_/¯

2 Answers 2


I'm sure it ought to have been obvious, but the following resolved this problem. An apt search returns two versions of pip. I had assumed, but not checked, that the system-wide version of python I was running was 3.x and so had overlooked the following. Typically, I had been working in venvs most of the time.

$ sudo apt-get install python3-pip

I then reinstalled pipenv as a user install:

$ pip install --user pipenv

Which left me only to install a specific version of py3status to satisfy a dependency as debian unstable was overshooting it:

$ pip install py3tatus==3.16

If there is a more elegant or pythonic way of doing this, I'd be glad to hear of it, but this seems close enough for rock 'n' roll.

edit: see edit above for important context.


Have you updated your pip and/or pipenv? Since you've updated to a newer version, it might mean that your packages need updating too (to be compatible). Try adding the version number after your pip commands (e.g pip3 - which I use). In these cases, if you used pip (since it's a later version and so you wouldn't have installed it, then using it to install a package will not work. Either way, you may need to install pip3 or update to it.

  • Thanks for the tip. I've had no major issues to date but it is true that my system-wide pip is 2.7. I have various venvs set up on either pipenv or with pip3. Probably, the above points to a wider issue touching on FrankenDebian territory so I'm getting my head around that piecemeal.
    – krozruch
    Oct 14, 2019 at 14:06
  • @krozruch If the answer worked for you, please upvote so others may use this information in the future!
    – MT_dev
    Oct 16, 2019 at 0:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.