Essentially I cannot seem to activate my virtualenv environment which I create.
I'm doing this inside of Windows PowerShell through using
scripts\activate
but I get an error message:
"cannot be loaded because the execution of scripts is disabled on this system".
Could this be because I don't carry administrator privileges on my computer?
Setting up virtualenv This can be done by activating the activate script in the Scripts folder. The following command creates an activate. bat batch file after activation. This creates an activate.
Check the $VIRTUAL_ENV environment variable. The $VIRTUAL_ENV environment variable contains the virtual environment's directory when in an active virtual environment. Once you run deactivate / leave the virtual environment, the $VIRTUAL_ENV variable will be cleared/empty.
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
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With