I got ModuleNotFoundError: No module named 'graphene_django' error after I added 'graphene_django' in settings.py and run the python manage.py runserver command. I installed django, graphene-django using pip but no use. I tried with virtual env and with out too, got the same issue.
I followed the below article to build GraphQL and I got issue from Integrating Graphql into the project steps: pip install graphene-django added graphene_django to INSTALLED_APPS in your settings.py file added endpoint steps in ecommerce/urls.py file created schema, in the products/ directory with a file name schema.py and run python manage.py runserver to test GraphQL API
see the output(python manage.py runserver) and error info:
Watching for file changes with StatReloader
Exception in thread django-main-thread:
Traceback (most recent call last):
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/threading.py", line 973, in _bootstrap_inner
self.run()
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/threading.py", line 910, in run
self._target(*self._args, **self._kwargs)
File "/Users/kalyan.avasarala/Library/Python/3.9/lib/python/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/Users/kalyan.avasarala/Library/Python/3.9/lib/python/site-packages/django/core/management/commands/runserver.py", line 125, in inner_run
autoreload.raise_last_exception()
File "/Users/kalyan.avasarala/Library/Python/3.9/lib/python/site-packages/django/utils/autoreload.py", line 87, in raise_last_exception
raise _exception[1]
File "/Users/kalyan.avasarala/Library/Python/3.9/lib/python/site-packages/django/core/management/__init__.py", line 398, in execute
autoreload.check_errors(django.setup)()
File "/Users/kalyan.avasarala/Library/Python/3.9/lib/python/site-packages/django/utils/autoreload.py", line 64, in wrapper
fn(*args, **kwargs)
File "/Users/kalyan.avasarala/Library/Python/3.9/lib/python/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/kalyan.avasarala/Library/Python/3.9/lib/python/site-packages/django/apps/registry.py", line 91, in populate
app_config = AppConfig.create(entry)
File "/Users/kalyan.avasarala/Library/Python/3.9/lib/python/site-packages/django/apps/config.py", line 193, in create
import_module(entry)
File "/Library/Developer/CommandLineTools/Library/Frameworks/Python3.framework/Versions/3.9/lib/python3.9/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
File "<frozen importlib._bootstrap>", line 984, in _find_and_load_unlocked
**ModuleNotFoundError: No module named 'graphene-django'**
see the version details:
ecommerce % pip list
Package Version
aniso8601 9.0.1 asgiref 3.5.2 Django 4.1.4 graphene 3.2.1 graphene-django 3.0.0 graphql-core 3.2.3 graphql-relay 3.2.0 pip 22.3.1 promise 2.3 setuptools 65.6.3 six 1.16.0 sqlparse 0.4.3 text-unidecode 1.3 wheel 0.38.4
I tried all the steps in the virtual environment (env). I tried creating same steps after I deleted e-commerce folder but not use and I tried to install django, graphene-django without virtual env too but no use.
Its on Mac laptop.
please share me steps or solution for the above issue.Thanks