What is the alternative for source command in cmd?
49,400
Solution 1
At CMD prompt,it worked by running
myvenv\scripts\activate.bat
Solution 2
For activating an environment:
activate myenv
for deactivating (all)
deactivate
Solution 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>
Author by
blank_mind
Updated on September 18, 2022Comments
-
blank_mind over 1 year
I want to run the Windows (Command Prompt) equivalent of
source myvenv/bin/activate
so as to activate and enter into my virtual environment.
-
Admin almost 6 yearsBatch file can automate what you want, but you need to know what
activate
does, and translate it accordingly. -
Admin almost 6 yearsWell I do not have any idea how to do this :/
-
Admin almost 6 yearsIf you have solved the problem, please post your answer as an answer in the “Your Answer” box (below).
-
-
blank_mind almost 6 yearsnot working says 'activate' not a recognized command
-
MarianD almost 6 yearsDid you used
conda
for creating your environments? Try the commandconda
from your cmd window. -
Anaksunaman almost 6 yearsGiven this self-answer, the asker appears to be using vanilla Python and virtual environments created with
python -m venv some-environment
(rather than, say, usingconda
). -
Señor CMasMas almost 5 yearsSpecific to your question "What is the alternative for source command in cmd?" The equivalent command to "source" is "call".. but it is only used from another batch file.