Search code examples
pythondjangoenvironment

How to activate Virtual Environment in DJango


I am currently on Windows and the Venv is not getting activatedUnactivated ENV, Is there any way to fix this. Thanking you guys in advance! Help out a newbie!


Solution

  • In windows: Press Windows (or Windows+R) and then type “cmd”: Run the Command Prompt in normal mode.

    1. cd C:\Users\user\Desktop\UserDjangoProject> pip install virtualenv
    2. For Create a venv run this virtualenv -p python3 venv
    3. Activate virtualenv venv\Scripts\activate
    4. It will look like this (venv) C:\Users\user\Desktop\UserDjangoProject>
    5. Then run pip install -r requirements.txt
    6. Run the django project run this./manage.py runserver