Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

virtualenv activate does not work

I am trying to create a virtual environment to test an api.

I can create the environment just fine using virtualenv test, then I can cd into it. When I try to run activate, I get this error:

PS C:\Users\Bright Bridge\Desktop\autocomplete_demo\Scripts> activate
activate : The term 'activate' 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
+ activate
+ ~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (activate:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundException


Suggestion [3,General]: The command activate was not found, but does exist in the current location. Windows PowerShell does not load commands from the current
 location by default. If you trust this command, instead type: ".\activate". See "get-help about_Command_Precedence" for more details.

I recently updated windows, and it replaced the cmd with Windows Powershell. My virtualenv worked fine with the cmd, so I suspect it may have to do with the way the Powershell does things.

How can I activate the virtualenv?

like image 265
wanderer0810 Avatar asked May 26 '17 05:05

wanderer0810


2 Answers

If you press WindowsKey + R, and type cmd when the box comes up, it should bring up the command line interface instead of powershell!

like image 178
AetherUnbound Avatar answered Sep 22 '22 00:09

AetherUnbound


For those of you still interested, the output gives you the answer:

If you trust this command, instead type: ".\activate".

So use a relative path name to run the activate script in powershell, or use an absolute path

like image 32
Bugbeeb Avatar answered Sep 19 '22 00:09

Bugbeeb