我正在尝试使用以下命令在powershell上运行virtualenv脚本来激活它:
.\env\Scripts\activate.ps1
但我收到此错误:
.\env\Scripts\activate.ps1 : File C:\Users\user\Desktop\tranning\env\Scripts\activate.ps1 cannot be loaded because running scripts is disabled on this
system. For more information, see about_Execution_Policies at https:/go.microsoft.com/fwlink/?LinkID=135170.
At line:1 char:1
+ .\env\Scripts\activate.ps1
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : SecurityError: (:) [], PSSecurityException
+ FullyQualifiedErrorId : UnauthorizedAccess
我阅读了article,并尝试通过以管理员身份运行powershell并键入以下命令来解决此问题:
Set-ExecutionPolicy RemoteSigned
但不幸的是没有改变
答案 0 :(得分:0)
根据这个先前提出的问题,您可以尝试其他一些方法: PowerShell says "execution of scripts is disabled on this system."
从链接中总结:
OR
powershell -ExecutionPolicy ByPass -File script.ps1