Home > database >  Getting the error : ImportError: cannot import name 'to_const'
Getting the error : ImportError: cannot import name 'to_const'

Time:05-18

getting the following import error in my Django(graphene) application, is there a workaround ?

from graphene.utils.str_converters import to_camel_case, to_const
ImportError: cannot import name 'to_const'

CodePudding user response:

Looks to me like to_const does not exist in the module str_converters. Which is why you are getting this error.

Source: https://github.com/graphql-python/graphene/blob/master/graphene/utils/str_converters.py

CodePudding user response:

Error : ? the above error results from package upgrade, that causes mismatches in dependencies

Solution : ? To clear the error above i downgraded the following packages to the versions shown below:

aniso8601==7.0.0 
graphene==2.1.8
graphql-core==2.3.2
graphql-relay==2.0.1

and the error cleared.

  • Related