出现的问题
Pycharm升级至2022.1版,第一次建立新的project就报错,
File D:\Web\venv\Script\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.
截图如下:
解决方案
使用Administrator打开Powershell,查看Powershell的执行政策Excecution Policies。
Get-ExecutionPolicy
Restricted
默认的为Restricted,我们将其改为RemoteSigned
代码为Set-ExecutionPolicy RemoteSigned
关闭Pycharm,再次打开Pycharm软件,点击Terminal问题解决