当在pycharm中加载python文件时,我得到了以下警告,之前它并不存在,print('Hello')
也按预期工作,但我无法安装django。
File C:\Users\abhi\PycharmProjects\django_apps\venv\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.
+ CategoryInfo : SecurityError: (:) [], ParentContainsErrorRecordException
+ FullyQualifiedErrorId : UnauthorizedAccess
1条答案
按热度按时间jyztefdp1#
试着检查一下这个,它可能会有帮助。
以下是您可以执行PowerShell指令码的方法:
开启Windows PowerShell或您目前使用之IDE的管理层级终端机。输入
Get-ExecutionPolicy
。它会显示目前PowerShell工作阶段的原则。您也可以输入Get-ExecutionPolicy -List
,列出所有领域的原则。get-execution-policy变更您想要之领域的执行原则。您需要的命令如下:Set-ExecutionPolic
y-ExecutionPolicy <policy name> -Scope <scope>
。一般来说,我们建议使用Set-ExecutionPolicy -Scope CurrentUser
-ExecutionPolicy RemoteSigned
,因为它更安全。set-execution-policy如果它不能解决问题,请输入:Set-ExecutionPolicy -Scope CurrentUser -ExecutionPolicy Unrestricted
Link