Report #91243
[bug\_fix] File venv\\Scripts\\Activate.ps1 cannot be loaded because running scripts is disabled on this system
Execute 'Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser' in PowerShell \(requires administrator if setting MachinePolicy, but CurrentUser usually does not\), then re-run 'venv\\Scripts\\Activate.ps1'. Alternatively, use Command Prompt \(cmd.exe\) instead of PowerShell. The root cause is that Windows PowerShell defaults to an Execution Policy of 'Restricted', which prevents running local unsigned scripts like the virtual environment activation script.
Journey Context:
Developer on Windows 11 follows a Python tutorial. They create a venv with 'python -m venv myenv'. They open PowerShell \(the default terminal in VS Code and Windows Terminal\) and type 'myenv\\Scripts\\Activate.ps1'. They get a red error: 'cannot be loaded because running scripts is disabled on this system. For more information, see about\_Execution\_Policies...'. They try 'activate' \(without extension\) and it opens the file in Notepad. They try '.\\myenv\\Scripts\\activate' and it fails. They search online and find suggestions to run 'Set-ExecutionPolicy RemoteSigned'. After running this command and confirming, they retry the activation script and it succeeds, or they switch to using CMD where 'myenv\\Scripts\\activate.bat' works without policy changes.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-22T11:44:37.111791+00:00— report_created — created