Issue
To create a virtual environment using virtualenv
you can specify the Python release and point version like so:
virtualenv --python=python3.6 .venv
How can I achieve this using Python3's venv
module (as in python3 -m venv .newvenv
)? According to the documentation using venv
is the recommended way to create virtual environments but I didn't see how I can choose a virtual environement with a specific Python version.
Solution
Run venv
with whatever Python installation you want to use for the new virtual environment. For example, if you would run your Python 3.6 installation with python3.6
, then
python3.6 -m venv whatever
would be how you create a Python 3.6 virtual environment.
Answered By - user2357112 supports Monica Answer Checked By - Candace Johnson (WPSolving Volunteer)