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
-
1The last line gives you the possible solutions. Are you sure you installed Django in the virtual environment?voodoo-burger– voodoo-burger2020年05月17日 10:59:04 +00:00Commented 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.Yash Marmat– Yash Marmat2020年05月17日 18:39:48 +00:00Commented May 17, 2020 at 18:39
1 Answer 1
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
Yash Marmat
1,20513 silver badges20 bronze badges
Sign up to request clarification or add additional context in comments.
Comments
lang-py