1

I am trying to activate virtualenv on windows 10x64 by using this command:

source \env\Scripts\activate.bat

but I get this error:

source : The term 'source' is not recognized as the name of a cmdlet, function, script file, 
or operable program. Check the spelling of the name, or if a path was included, verify that 
the path is correct and try again.
At line:1 char:1
+ source \env\Scripts\activate.bat
+ ~~~~~~
    + CategoryInfo          : ObjectNotFound: (source:String) [], CommandNotFoundException  
    + FullyQualifiedErrorId : CommandNotFoundException
Amir Makram
  • 12,030
  • 3
  • 13
  • 25

2 Answers2

3

Ok about that, source is a shell command that only used in Linux systems, but not for windows systems. In window you should run it as...(Let's assume directory is inside of C:)

C:\Users\env\Scripts\activate.bat
Govinda Malavipathirana
  • 1,095
  • 2
  • 11
  • 29
2

I had the same problem on Windows 10 too. Unfortunately, source can only be used on Linux-based systems. After several rabbit holes searching, I was able to solve it. Assuming your directory appears like this:

C:\Users\Workspace> 

Just type in front of that:

C:\Users\Workspace> .\virt_env\Scripts\activate

Assuming virt_env is the name of your virtual environment.