1

i created a virtual environment for django and im trying to start the server but i keep running into this problem

(Django-8VqULu7_) C:\Users\rondo11\Documents\learn how to program\learning python\Django>py manage.py runserver
Traceback (most recent call last):
 File "manage.py", line 10, in main
 from django.core.management import execute_from_command_line
ModuleNotFoundError: No module named 'django'
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
 File "manage.py", line 21, in <module>
 main()
 File "manage.py", line 16, in main
 ) from exc
ImportError: Couldn't import Django. Are you sure it's installed and available on your PYTHONPATH environment variable? Did you forget to activate a virtual environment?

what is the problem?

oguz ismail
51.9k16 gold badges64 silver badges83 bronze badges
asked May 17, 2020 at 10:32
2
  • 1
    The last line gives you the possible solutions. Are you sure you installed Django in the virtual environment? Commented May 17, 2020 at 10:59
  • you forgot to start virtual environment. if you dont know how to create a virtual environment than steps are below. Commented May 17, 2020 at 18:39

1 Answer 1

2

Create a virtual evironment

pipenv shell install django install django in virtual environment

pipenv shell to run the virtual environment

python manage.py runserver to start the server

answered May 17, 2020 at 18:45
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

Draft saved
Draft discarded

Sign up or log in

Sign up using Google
Sign up using Email and Password

Post as a guest

Required, but never shown

Post as a guest

Required, but never shown

By clicking "Post Your Answer", you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.