Execute script on powershell

After creating the virtual environment, when activating the virtual environment, the Win environment Powershell I used reported an error: Cannot load xxx.ps1 because scripts are forbidden on this system. As shown below:

After consulting, I learned that when Windows PowerShell was started on the computer for the first time, the current execution policy was probably the default setting Restricted. The Restricted policy does not allow any scripts to run.

solution

When executing the command Set-ExecutionPolicy RemoteSignedexecution policy change in PowerShell, the following prompt will appear:

For security reasons, we only allow this policy change, type "Y" and press Enter.
The virtual environment is activated normally:

Guess you like

Origin blog.csdn.net/qq_35576225/article/details/108536808