Change Python Version in Pipenv
Apr 13, 2021
A recent upgrade to Ubuntu 20.04 messed up one of my projects which depended on python3.7 and I had to switch over to a higher version, however, it took a lot of googling, trial and error before I figured out how to make the switch in Pipenv.
Here’s a step by step guide on how to do this:
1. Change the “python_version” variable in your Pipfile to the new version you want. In my case it was python_version = “3.8”
2. Open your terminal and runpipenv install --python=/path/to/your/python
This would remove the previous virtual environment and create a new one using the python version specified.
Hope this helps :)