How do I use different Python version in venv from standard library? (Not virtualenv!)

python, python-venv

Solution

It's simply impossible. To create a Python venv of a specific Python version, we need this specific version.

Obviously, a Python interpreter doesn't "include" all the previous versions with their behavior. Python 3.4.1 cannot contain Python 2.7.8 executable anywhere inside.

Problem

I have installed Python 3.4.0 and created virtual environment with `python -m venv myenv`. How can I change Python version in my virtual environment? Documentation says: Each virtual environment has its own Python binary (allowing creation of environments with various Python versions) and can have its own independent set of installed Python packages in its site directories. UPDATE Please, note that I ask about venv from standard library, not about virtualenv. Let me provide some links. - This is PEP 405. http://legacy.python.org/dev/peps/pep-0405/ - Python venv. http://docs.python.org/3.4/library/venv.html - Virtualenv. http://www.virtualenv.org/en/latest/ I don't see something like a `--python` flag in venv. Are venv and virtualenv absolutely similar? Is venv is so unpopular and no one uses it so that virtualenv remains the standard?

Original source

Related problems