Answer the question
In order to leave comments, you need to log in
Why is there a Django module import error?
Installed the virtual environment, installed django, when writing the django-admin --version command, the required version is shown
When I try to start the local server, it gives out
Tried:
1) Deleting the virtual environment and restarting and then installing django
2) Tried to make 2 types of virtual environment:
Thus
python3 -m virtualenv demoEnv
python3 -m venv tutorial-env
(demoEnv) PS E:\frontendprog\projeckt2\my_django_project> python3 manage.py runserver
Traceback (most recent call last):
File "E:\frontendprog\projeckt2\my_django_project\manage.py", line 11, 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 "E:\frontendprog\projeckt2\my_django_project\manage.py", line 22, in
main()
File "E:\frontendprog\projeckt2\my_django_project\manage.py", line 13, in main
raise ImportError(
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?
pip freeze > requirements.txtcreates the following dependencies
asgiref==3.5.0
Django==4.0.4
Pillow==9.1.0
sorl-thumbnail==12.8.0
sqlparse==0.4.2
tzdata==2022.1
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question