Due to company constraints I cannot immediately execute PowerShell commands:
File C:...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
The workaround I already found (thanks Stack!) is to execute, in the command line (not as a PS script):
Set-ExecutionPolicy Unrestricted -Scope Process
This solves the problem and when I'm running code for real, it works well. When I am in the middle of a development/debugging session in VS Code, however, this command does not execute.
Is there a place in one of the JSON setup files where I can pre-execute the above command before PS or cmd or the python debugger attempts to run Activate.ps1
? This fixes venv problems for me and anyone else with problematic corporate script execution policies.