17

I want to run the Windows (Command Prompt) equivalent of

source myvenv/bin/activate

so as to activate and enter into my virtual environment.

5 Answers5

7

At CMD prompt,it worked by running

myvenv\scripts\activate.bat
Dave M
  • 13,250
4

For activating an environment:

activate myenv

for deactivating (all)

deactivate
MarianD
  • 2,726
3

Go to the the directory where you have the ".bat" file by executing this command:

C:\Users\MyName\Desktop\ProjectsWork\FlaskApplication> cd env\Scripts

Then just call the ".bat" file

\Desktop\ProjectsWork\FlaskApplication\env\Scripts> activate.bat

(env) C:\Users\MyName\Desktop\ProjectsWork\FlaskApplication\env\Scripts>

Mourad
  • 139
1

If you want to use your environment in batch file then

call C:\ProgramData\Anaconda3\Scripts\activate.bat C:\ProgramData\Anaconda3

All the following command will be executed in virtual environment

0

If you want to activate your virtual environment after running:

virtualenv env  

Just run:

env\Scripts\activate

This command will provide you the correct path and the command "source" is not necessary.

Example Image

Karen
  • 9