Fix Python – ‘virtualenv’ won’t activate on Windows


Asked By – SScode

Essentially I cannot seem to activate my virtualenv environment which I create.

I’m doing this inside of Windows PowerShell through using


but I get an error message:

“cannot be loaded because the execution of scripts is disabled on this

Could this be because I don’t carry administrator privileges on my computer?

Now we will see solution for issue: ‘virtualenv’ won’t activate on Windows


According to Microsoft Tech Support it might be a problem with Execution Policy Settings. To fix it, you should try executing Set-ExecutionPolicy Unrestricted -Scope Process (as mentioned in the comment section by @wtsiamruk) in your PowerShell window. This would allow running virtualenv in the current PowerShell session.

There is also another approach that is more unsafe, but recommended by MS Tech Support. This approach would be to use Set-ExecutionPolicy Unrestricted -Force (which do unleash powers to screw Your system up). However, before you use this unsafe way, be sure to check what your current ExecutionPolicy setting is by using get-ExecutionPolicy. Then, when you are done, you can revert back to this ExecutionPolicy by using Set-ExecutionPolicy %the value the get-ExecutionPolicy command gave you% -Force.

This question is answered By – Kamiccolo

This answer is collected from stackoverflow and reviewed by FixPython community admins, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0