Skip to content

ImportError: cannot import name 'MiddlewareManager' #291

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
danfairs opened this issue Sep 16, 2016 · 3 comments
Closed

ImportError: cannot import name 'MiddlewareManager' #291

danfairs opened this issue Sep 16, 2016 · 3 comments

Comments

@danfairs
Copy link

danfairs commented Sep 16, 2016

Hi!

I'm just playing with GraphQL with Django. While running runserver, I immediately get a traceback:

(unrest) boatman:taxnav dan$ python manage.py runserver
Unhandled exception in thread started by <function check_errors.<locals>.wrapper at 0x10ea1eae8>
Traceback (most recent call last):
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/django/core/management/commands/runserver.py", line 113, in inner_run
    autoreload.raise_last_exception()
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/django/utils/autoreload.py", line 249, in raise_last_exception
    six.reraise(*_exception)
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/django/utils/six.py", line 685, in reraise
    raise value.with_traceback(tb)
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/django/utils/autoreload.py", line 226, in wrapper
    fn(*args, **kwargs)
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/django/__init__.py", line 27, in setup
    apps.populate(settings.INSTALLED_APPS)
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/django/apps/registry.py", line 85, in populate
    app_config = AppConfig.create(entry)
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/django/apps/config.py", line 90, in create
    module = import_module(entry)
  File "/usr/local/Cellar/python3/3.5.1/Frameworks/Python.framework/Versions/3.5/lib/python3.5/importlib/__init__.py", line 126, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 986, in _gcd_import
  File "<frozen importlib._bootstrap>", line 969, in _find_and_load
  File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 673, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 662, in exec_module
  File "<frozen importlib._bootstrap>", line 222, in _call_with_frames_removed
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/graphene_django/__init__.py", line 1, in <module>
    from .types import (
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/graphene_django/types.py", line 5, in <module>
    from graphene import ObjectType, Field
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/graphene/__init__.py", line 19, in <module>
    from .types import (
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/graphene/types/__init__.py", line 8, in <module>
    from .schema import Schema
  File "/Users/dan/Envs/unrest/lib/python3.5/site-packages/graphene/types/schema.py", line 2, in <module>
    from graphql import GraphQLSchema, MiddlewareManager, graphql, is_type
ImportError: cannot import name 'MiddlewareManager'

(unrest) boatman:taxnav dan$ pip freeze | grep -i "graph\|django"
Django==1.10
django-filter==0.11.0
django-graphiql==0.4.4
django-model-utils==2.5.2
djangorestframework==3.4.6
graphene==1.0.dev0
graphene-django==1.0.dev20160910000001
graphql-core==0.5.3
graphql-django-view==1.3
graphql-relay==0.4.4

What's up here? Thanks!

@femesq
Copy link
Contributor

femesq commented Sep 16, 2016

Probably because graphql-core's version. Try going to 1.0.dev for this package too.
If you need middleware, wait for this [https://github.com/GraphQL-python-archive/graphql-django-view/issues/14] to get solved.

Good luck,

@danfairs
Copy link
Author

Updating the version fixed it for me - thanks! I'll leave this issue open if you're using it to track docs changes.

@syrusakbary
Copy link
Member

removed my comment as I pointed in the bad direction and could mislead other people having this problem.

Closing the issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants