简体   繁体   中英

I can't activate my virtual environment in PowerShell

When i try activate my virtual environment in CMD, doesn't exit any problem but in PowerShell i'm having that error:

PS C:\Users\Burak\desktop\my-site\myenv\Scripts> activate.bat
activate.bat : The term 'activate.bat' is not recognized as the name of a cmdlet, function, script file, or operable program. Check t
he 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.bat
+ ~~~~~~~~~~~~
    + CategoryInfo          : ObjectNotFound: (activate.bat:String) [], CommandNotFoundException
    + FullyQualifiedErrorId : CommandNotFoundExceptionenter code here

try activate or./activate instead activate.bat if it don't help then try this:

You need to set windows execution policies. According to official documentation of virtualenv.

Run in powershell

 Set-ExecutionPolicy -ExecutionPolicy RemoteSigned > -Scope CurrentUse

Now you can activate virtual env. using \Scripts\Activate.ps1

Hope it solves it!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM