Essentially I cannot seem to activate my virtualenv environment which I create.
I\'m doing this inside of windows powershell through using
scripts\\a
In windows Powershell the ExecutionPolicy is set to 'restricted' by default. This does not allow scripts to be run in Powershell.
We can only run scripts when the ExecutionPolicy is set to 'RemoteSensing' from 'Restricted' You can follow the following video to do that! https://www.youtube.com/watch?v=Q2uLUuq0Ft4
After the above step ; you can directly type "Scrits/activate" (while being in the directory of the virtual environment that you want to activate) to activate the virtual environment that you wish to activate !
example
If you don't want to change your computer's execution policy on windows like I do, you can use windows command prompt instead of windows powershell, and just need to run
Scripts\activate
to activate your env
If you have used pipenv
in creating your virtual environment you should run pipenv shell
before executing any command in vs code terminal
Set the ExcutionPolicy for the Process Scope after Yes [y] then type Scripts/activate
To install a virtual environment in Windows Powershell only but to activate you'll need to run Windows powershell as Administrator
pip install virtualenv
virtualenv %Name of virtual environment%
It is installed now to activate it, run powershell in as administrator
.\env\Scripts\activate
To deactivate the environment
.\env\Scripts\deactivate
Hope it helps.
For more help do visit the official page https://pypi.org/project/virtualenv/1.8.2/
Open another powershell as admin and then type:
set-executionpolicy remotesigned
Then Press y
and then enter.
Now close this powershell and go back to shell you were working with. This will solve the issue.