question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

import graphene not working

See original GitHub issue

import graphene gives me the following error

Traceback (most recent call last):
  File ".../app.py", line 1, in <module>
    import graphene
  File ".../anaconda/lib/python3.6/site-packages/graphene/__init__.py", line 3, in <module>
    from .types import (
  File ".../anaconda/lib/python3.6/site-packages/graphene/types/__init__.py", line 2, in <module>
    from graphql import ResolveInfo
ImportError: cannot import name 'ResolveInfo'

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:7 (3 by maintainers)

github_iconTop GitHub Comments

14reactions
dongyuzhengcommented, Sep 26, 2017

EDIT: I had a folder called graphql in my path. Changing its name fixed this.

I have the same issue:

(venv) PS D:\backend\backend> python .\manage.py runserver

...

  File "D:\backend\venv\lib\site-packages\graphene\types\__init__.py", line 2, in <module>
    from graphql import ResolveInfo
ImportError: cannot import name 'ResolveInfo'
(venv) PS D:\backend\backend> pip freeze
colorama==0.3.9
decorator==4.1.2
Django==1.11.5
graphene==2.0.dev20170802065539
graphene-django==2.0.dev2017083101
graphql-core==2.0.dev20170801051721
graphql-relay==0.4.5
ipdb==0.10.3
ipython==6.2.0
ipython-genutils==0.2.0
iso8601==0.1.12
jedi==0.10.2
pickleshare==0.7.4
promise==2.1.dev0
prompt-toolkit==1.0.15
Pygments==2.2.0
pytz==2017.2
simplegeneric==0.8.1
singledispatch==3.4.0.3
six==1.11.0
traitlets==4.3.2
typing==3.6.2
wcwidth==0.1.7
(venv) PS D:\backend\backend> python --version
Python 3.6.2
(venv) PS D:\backend\backend>
2reactions
jkimbocommented, Jul 24, 2019

@mbrochh if you install the latest version of graphene-django (2.4.0) it should resolve graphql-core correctly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to solve "Could not import 'todo.schema ... - Stack Overflow
You have a typo at text = graphene.string(Required=True) . It also says in the error that graphene doesn't have an attribute string.
Read more >
install - graphene - django
Add graphene_django to the INSTALLED_APPS in the settings.py file of your Django project: ; We need to add a graphql URL to the...
Read more >
graphene - PyPI
import graphene class Query(graphene. ... We appreciate opening issues and pull requests to make graphene even more stable & useful!
Read more >
Graphene Documentation - Read the Docs
from graphene import ObjectType, String, Schema ... By default all field and argument names (that are not explicitly set with the name arg) ......
Read more >
Error Handling - graphql-python
In this chapter, you'll understand how GraphQL and Graphene address these issues. Schema Errors. Being a language with a strong type system, GraphQL...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found