lgants
lgants

Reputation: 3835

Docker app cannot find module named 'graphene_django'

I used the Django Rest Framework cookiecutter available here to scaffold a project. I've made no changes aside from setting up a virtualenv, installing requirements, and running pip install graphene_django. However, when I add graphene_django to the INSTALLED_APPS I receive the following error when attempting to run the server:

ModuleNotFoundError: No module named graphene_django

Any ideas why?

Traceback:

Traceback (most recent call last):
  File "manage.py", line 24, in <module>
    execute_from_command_line(sys.argv)
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 371, in execute_from_command_line
    utility.execute()
  File "/usr/local/lib/python3.6/site-packages/django/core/management/__init__.py", line 347, in execute
    django.setup()
  File "/usr/local/lib/python3.6/site-packages/django/__init__.py", line 24, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/usr/local/lib/python3.6/site-packages/django/apps/registry.py", line 89, in populate
    app_config = AppConfig.create(entry)
  File "/usr/local/lib/python3.6/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/local/lib/python3.6/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 994, in _gcd_import
  File "<frozen importlib._bootstrap>", line 971, in _find_and_load
  File "<frozen importlib._bootstrap>", line 953, in _find_and_load_unlocked

Pip freeze:

...
graphene-django==2.0.0
...

Command to run app: docker-compose up

Upvotes: 1

Views: 527

Answers (1)

lgants
lgants

Reputation: 3835

The issue seems be related to Docker (or more specifically, me being unfamiliar with Docker). Running the docker-compose up --build command solved the issue. Hopefully, that helps someone else!

Upvotes: 1

Related Questions