I'm building an API using Django REST Framework with this tutorial. I'm getting a ModuleNotFoundError: No module named 'django'
error when I try to test python3 manage.py
. I've been going through the long list of issues it could be (reinstall django, need to add an __init__.py
in the root, etc) and someone recommended checking my modules list with pip3 list
.
Here's what I see:
Package Version
------------------- -------
asgiref 3.3.1
dj-database-url 0.5.0
Django 3.1.4
django-filter 2.4.0
django-heroku 0.3.1
djangorestframework 3.12.2
gunicorn 20.0.4
Is there a reason why Django's capitalized? Could that be why it isn't finding it in manage.py
? If so, how do I go about fixing it?
Here's the full error message I'm getting, but it's really general. The exception is hardcoded:
Traceback (most recent call last):
File "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 "manage.py", line 22, in <module>
main()
File "manage.py", line 17, 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?