I would like to know if it is possible to specify the python version in a virtual environment (created with virtualenv and virtualenvwrapper) after the environment is created.
If I create a virtualenv with the following command:
mkvirtualenv -p python3.8 venvname
I would like to know:
I can be sure that I am using python3.8 by just typing python
when the virtual environment is activated and it will display something like the following:
Python 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0] on linux Type "help", "copyright", "credits" or "license" for more information. >>>
The only way to specify the python version in the mkvirtualenv
command is (as far as I know) to have python3.8 installed beforehand
Indeed, if for example I do
mkvirtualenv -p python3.6 venvname
I get the following error
RuntimeError: failed to find interpreter for Builtin discover of python_spec='python3.6'
since I don't have python3.6 installed.
My question is:
Can I change the python version installed in my virtualenv after having created it?
Thanks in advance to anyone who will try to help me.