Ubuntu 20.04 has Python 3.6 and Python 3.8 support. Command python3 -m venv my_venv
creates virtual environment with python 3.8 and it works as expected.
However, trying python3.6 -m venv my_venv3.6
does not work. The response I get is /usr/bin/python3.6: No module named venv
.
I tried using virtualenv --python=/usr/bin/python3.6 my_venv3.6
, which results in:
RuntimeError: failed to query /usr/bin/python3.6 with code 1 err: ...
I also tried installing sudo apt install python3.6-venv
which results in:
Reading package lists... Done
Building dependency tree
Reading state information... Done
Package python3.6-venv is not available, but is referred to by another package.
This may mean that the package is missing, has been obsoleted, or
is only available from another source
E: Package 'python3.6-venv' has no installation candidate
Note that running python3.6
starts interactive python prompt with Python 3.6.9. I can also run scripts this way, so it seems that Python 3.6 is indeed usable on my system.
How can I start Python 3.6 virtual environment on Ubuntu 20.04?
python-virtualenv
. Rather, you will need to use: ``` apt-get install python3-virtualenv ``` Then to create your virtual environment for Python 3.6 you can simply do: ``` virtualenv -p python3.6 env ``` Hope this helps someone else.sudo apt-get install python3.6-venv
.