Virtualenv is one of the most important tools in Python developers' toolkit.
Now that Virtualenv supports PowerShell natively, you can run the script
venv/Scripts/Activate.ps1
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
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)
Thank you :)
Glad it helped 👍
Thanks
Thanks !