I have created a virtual environment using python 3.6, then I've made a system upgrade and I've got python 3.7 installed system wide. Now I can't execute python files in that virtual environment because it's searching for python 3.6.
How can I upgrade the virtualenv python version to match the system wide version or how to downgrade the python version for that particular virtual environment?
I'm using manjaro.
EDIT 1
Did some testing and found another more "graceful" way to (at least) update the executable. Let's assume the virtual env was initially created like so
virtualenv -p /path/to/my/python2.7 .venv
. The executable can be updated to a specific python version like so:virtualenv --clear -p /path/to/my/python3.6 .venv
. Please validate thepython
symlink in.venv/bin/python
is updated usingls -la .venv/bin/python
. The old executable(s) will still be in./venv/bin/
.Note: You need to have the specific target version of python installed.
See this link which explains it well.
Please let me/us know if this answer was helpful to you!