Diniz Martins

Dec 7, 20221 min

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:

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

Check the result of your ExecutionPolicy - here we have "restricted" and we need to change to "RemoteSigned"

After that, check if your policy changed:

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

All good!

    2460
    2