In Ubuntu 16.04 the latest release of Python3 is 3.5. If I just do virutalenv venv
it would create a new virtual environment using Python 3.5.
I followed the instructions in https://linuxize.com/post/how-to-install-python-3-8-on-ubuntu-18-04/ and installed Python 3.8 with apt
from the deadsnakes PPA. But I am still not able to create a Python 3.8 virtual environment. If I do virtualenv --python=/usr/bin/python3.8
, I got this:
user@host:~$ virtualenv --python=/usr/bin/python3.8 venv
RuntimeError: failed to query /usr/bin/python3.8 with code 1 err: 'Traceback (most recent call last):\n File "/usr/local/lib/python3.5/dist-packages/virtualenv/discovery/py_info.py", line 16, in <module>\n from distutils import dist\nImportError: cannot import name \'dist\' from \'distutils\' (/usr/lib/python3.8/distutils/__init__.py)\n'