[Solved] Django cannot create an app after creating a project

F:\index>python manage.py startapp news
Traceback (most recent call last):
File “manage.py”, line 8, in <module>
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 14, in <module>
) 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?
After creating a django project, adding python manage.py startapp news gives the following error
Uninstall django and install it again, can’t fix it
python -m pip install django problem solved
F:\index>python -m pip install django
Collecting django
Using cached https://files.pythonhosted.org/packages/ab/15/cfde97943f0db45e4f999c60b696fbb4df59e82bbccc686770f4e44c9094/Django-2.0.7-py3-none-any.whl
Requirement already satisfied: pytz in c:\programdata\anaconda3\lib\site-packages (from django)
Installing collected packages: django
Successfully installed django-2.0.7
You are using pip version 9.0.1, however version 10.0.1 is available.
You should consider upgrading via the ‘python -m pip install –upgrade pip’ command.

Similar Posts: