… cannot be loaded because Running scripts is disabled on this system

Share

If you’ve tried activating your Virtual Environment on VS Code, you might have possibly encountered this issue:

Issue: UnauthorizedAccess, SecurityError, PSSecurityException

Don’t worry, I’ve got you covered! There is a quick solution for this issue:

Quick Solution

CMD:> Get-ExecutionPolicy

Gets current execution policy for the user/machine. If it is set to Restricted, change it to RemoteSigned or Bypass (might open security vulnerabilities. Use as temporary solution, with caution), as specified below

Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

or

Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser

Now re-run:

.venv/Scripts/activate

Related Posts
Leave a Reply

Your email address will not be published. Required fields are marked *