create virtual environment python windows 10 code example
Example 1: create venv in windows
python -m venv <venv-name>
.\Scripts\activate.bat
Example 2: how to activate a venv in windows
\env\Scripts\activate.bat
Example 3: activate virtualenv windows
venv\Scripts\activate
Example 4: venv activate windows
cd_yourdir
>pip install virtualenv
>virtualenv "__"
E.G.
> virtualenv venv
>D:Projectdir/venv/scripts/activate.bat
DONE !!!
(venv) D:/projectdir>
Example 5: create environment python windows 10
python3 -m venv venv
Example 6: how to create virtualenv in specific directory in windows
Create a Virtual Python Environment
cd to your project directory and run virtualenv to create the new virtual environment.
The following commands will create a new virtual environment under my-project/my-venv.
cd my-project
virtualenv --python C:\Path\To\Python\python.exe venv