Python django cant activate virtual enviroment

Question:

I can’t activate virtual enviroment and get ‘cannot be loaded because running scripts is disabled on this system’

enter image description here

I tried to write ‘activate’ and ‘./activate’ but both dont work

Asked By: Serrator

||

Answers:

If you are using virtualenv.

venv bin/activate

I am condering venv is your envionment folder and you’re on the folder containing your virtual environment.

PS: you can create virtual environment using following command

virtualenv venv -p python3
Answered By: Nabin Bhusal

To solve this error:

Simply you can open powershell as admin and then execute below command:

set-executionpolicy remotesigned

You will be prompted to accept the change, type A(Yes to all), and press ENTER on your keyboard to allow the change.

Close the PowerShell admin window, and go back to the PowerShell Window where you got the error. Run the command below

venvScriptsactivate

And now your error is solved.

Answered By: Manoj Tolagekar
Categories: questions Tags: ,
Answers are sorted by their score. The answer accepted by the question owner as the best is marked with
at the top-right corner.