A virtual environment named dev-env was created in the current working directory. Which command will activate this environment (Windows)? The > character stands for a command prompt.

Questions & AnswersCategory: PythonA virtual environment named dev-env was created in the current working directory. Which command will activate this environment (Windows)? The > character stands for a command prompt.
Geek Boy Staff asked 2 years ago

A virtual environment named dev-env was created in the current working directory. Which command will activate this environment (Windows)? The > character stands for a command prompt.
a. 

> .\dev-env\Scripts\start
or
> .\dev-env\Scripts\start.bat

b. 

> .\dev-env\activate

c. 

> activate

d. 

> .\dev-env\Scripts\activate
or
> .\dev-env\Scripts\activate.bat
1 Answers
Lokesh Kumar Staff answered 2 years ago

d.

> .\dev-env\Scripts\activate
or 
> .\dev-env\Scripts\activate.bat

Explanation:

  • cmd.exe
    C:\> <venv>\Scripts\activate.bat
  • PowerShell
    PS C:\> <venv>\Scripts\Activate.ps1