windows how to activate virtual environment code example

Example 1: virtualenv activation program in cmd

.\venv\Scripts\activate

Example 2: create environment python windows 10

python3 -m venv venv

Example 3: 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