Create virtual environment with specific version of python

930 views Asked by At

I have two versions of python installed

C:\>python --version
Python 3.6.4

C:\>python39 --version
Python 3.9.0

I can create a virtual environment with the first version

C:\temp_folder>python -m venv env1

but I can't with the 3.9 version:

C:\temp_folder_2>python39 -m venv env2
Error: [WinError 2] The system cannot find the file specified

The env2 folder is created but most of the Scripts files are missing

1

There are 1 answers

1
Naman Doctor On

It should be python3.9 -m venv env2