Figured I would do a quick write up of the process to install pipenv on an Ubuntu or Debian system as I’ve screwed it up enough myself. Hopefully you might find this useful.
I’ve run into issues where I’ve installed pip3, then installed pipenv where everything looked correct. However, once I’ve completed the pipenv install via pip3, running pipenv fails with an error. Off the top of my head I forget the exact error but it’s along the lines of not being able to find pipenv. Turns out I was installing pipenv as my userid without using sudo. pip3 and pipenv need to be installed globally. If you’ve run into something like this, use the following steps:
- Remove pip3 by running ‘sudo apt remove python3-pip’.
- Reinstall pip3 by running ‘sudo apt install python3-pip’.
- Then install pipenv by running ‘sudo pip3 install pipenv’.
- Test your install by creating a temp directory in your home folder, cd into that directory and run ‘pipenv install’. If all goes well, you should be able to run ‘pipenv shell’ to test it out.
It’s really pretty simple, but it hasn’t stopped me from making the same mistake on several installs.