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:
- Django Run Error: RuntimeError: maximum recursion depth exceeded while calling a Python object
- Django exception-ImportError: No module named django.core.management
- ImportError: No module named pytz
- Django startup error: generator expression must be parentized
- django.core.exceptions.ImproperlyConfigured: Error loading MySQLdb module: No module named ‘M…
- ImportError: Couldn’t import Django [How to Solve]
- [Solved] Djiango Create Migrations Error: query = query.decode(errors=’replace’) AttributeError: ‘str’ object has no attribute ‘decode’
- Python2.7 Error: command not found: django-admin.py [How to Solve]
- Python AttributeError: ‘unicode’ object has no attribute ‘tzinfo’
- ERRORS: ?: (staticfiles.E002) The STATICFILES_DIRS setting should not contain the STATIC_ROOT set…