DEV Community

Anoop AK
Anoop AK

Posted on • Updated on


Enabling Python Virtualenv in Windows PowerShell

Virtualenv is one of the most important tools in Python developers' toolkit.
Now that Virtualenv supports PowerShell natively, you can run the script


which is the equivalent of venv/bin/activate in Linux

However, you might run into the following error when you try to run the script

venv\Scripts\Activate.ps1 cannot be loaded because running scripts is disabled on this system. For more information, see about_Execution_Policies

You may use Set-Execution Policy to allow the current user to execute scripts as follows

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope CurrentUser
Enter fullscreen mode Exit fullscreen mode

That's it! You should now be able to execute Activate.ps1 and get a fully isolated Python development environment for your projects.

Top comments (4)

mrmoshkovitz profile image

Thank you :)

aka_anoop profile image
Anoop AK

Glad it helped 👍

afey4rce profile image
ABENAMA Franck Emmanuel


mosaablaboune profile image
Mosaab Laboune

Thanks !

16 Libraries You Should Know as a React Developer

>> Check out this classic DEV post <<