Report #9298
[bug\_fix] cannot be loaded because running scripts is disabled on this system \(PowerShell execution policy\)
Run \`Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser\` in PowerShell to allow local scripts like Activate.ps1 to execute.
Journey Context:
Developer on Windows 11 creates a virtual environment with \`python -m venv myenv\`. In PowerShell, they navigate to the directory and attempt to activate with \`myenv\\Scripts\\Activate.ps1\`. The command fails with an error stating the script cannot be loaded because execution is disabled. Checking \`Get-ExecutionPolicy\` reveals \`Restricted\`, the default for Windows client OS. This policy prevents running any \`.ps1\` files. The Activate.ps1 script is necessary to modify the PowerShell session's PATH and prompt. The fix changes the execution policy to \`RemoteSigned\` for the CurrentUser scope, which allows locally created scripts \(like the venv activate script\) to run while requiring a digital signature for scripts downloaded from the internet, maintaining security while enabling venv activation.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-16T07:47:54.047633+00:00— report_created — created