Graphene-django: v2.8.0 not compatible with Django 3.0.2 regarding six

Created on 4 Jan 2020  路  10Comments  路  Source: graphql-python/graphene-django

I upgraded Django and graphene django but when I make a request I get this error

Could not import 'fieldrecords.schema.schema' for Graphene setting 'SCHEMA'. ImportError: cannot import name 'six'.

Most helpful comment

upgrade graphql_jwt version to 0.3.0 verion, I had same problem and solved by run this command try
pip install "django-graphql-jwt>=0.3.0"

All 10 comments

@a-c-sreedhar-reddy can you post the full output of pip freeze? six is a dependency for graphene Django so it should definitely be installed.

pip3 freeze

aniso8601==7.0.0
apturl==0.5.2
asgiref==3.2.3
asn1crypto==0.24.0
Babel==2.7.0
Brlapi==0.6.6
certifi==2018.1.18
chardet==3.0.4
command-not-found==0.3
cryptography==2.1.4
cupshelpers==1.0
defer==1.0.6
distro-info===0.18ubuntu0.18.04.1
Django==3.0.2
django-cors-headers==3.2.0
django-graphql-jwt==0.2.2
django-phonenumber-field==3.0.1
djangorestframework==3.10.3
djangorestframework-simplejwt==4.3.0
graphene==2.1.8
graphene-django==2.8.0
graphql-core==2.2.1
graphql-relay==2.0.0
httplib2==0.9.2
idna==2.6
keyring==10.6.0
keyrings.alt==3.0
language-selector==0.1
launchpadlib==1.10.6
lazr.restfulclient==0.13.5
lazr.uri==1.0.3
louis==3.5.0
macaroonbakery==1.1.3
Mako==1.0.7
MarkupSafe==1.0
netifaces==0.10.4
oauth==1.0.1
olefile==0.45.1
pexpect==4.2.1
phonenumbers==8.10.23
Pillow==5.1.0
promise==2.2.1
protobuf==3.0.0
pycairo==1.16.2
pycrypto==2.6.1
pycups==1.9.73
pygobject==3.26.1
PyJWT==1.7.1
pymacaroons==0.13.0
PyNaCl==1.1.2
pyRFC3339==1.0
pyserial==3.4
python-apt==1.6.4
python-dateutil==2.6.1
python-debian==0.1.32
pytz==2019.3
pyxdg==0.25
PyYAML==3.12
reportlab==3.4.0
requests==2.18.4
requests-unixsocket==0.1.5
Rx==1.6.1
SecretStorage==2.3.1
simplejson==3.13.2
singledispatch==3.4.0.3
six==1.13.0
sqlparse==0.3.0
ssh-import-id==5.7
system-service==0.3
systemd-python==234
ubuntu-drivers-common==0.0.0
ufw==0.36
unattended-upgrades==0.1
urllib3==1.22
usb-creator==0.3.3
wadllib==1.3.2
xkit==0.0.0
zope.interface==4.3.2

requirements.txt

aniso8601==7.0.0
Babel==2.7.0
Django==3.0.2
django-cors-headers==3.2.0
django-graphql-jwt==0.2.2
django-phonenumber-field==3.0.1
djangorestframework==3.10.3
djangorestframework-simplejwt==4.3.0
graphene==2.1.8
graphene-django==2.8.0
graphql-core==2.2.1
graphql-relay==2.0.0
phonenumbers==8.10.23
promise==2.2.1
PyJWT==1.7.1
pytz==2019.3
Rx==1.6.1
singledispatch==3.4.0.3
six==1.13.0
sqlparse==0.3.0

Django 3.0 removed a bunch of Python 2 compatibility APIs in lieu of Python 2 being deprecated, so it looks like we'll have to remove reliance on these APIs in graphene-django, probably with a major version bump.

Happy to help with this if there aren't any outstanding PRs already.

Try upgrade django-graphql-jwt to 0.3.0. There seems to be an import of django.utils.six in the older version of that package.
My graphene-django==2.8.0 is working fine so far with Django==3.0.2 .

@dvf yep Django 3 did remove all the six imports but graphene-Django has automated tests that run against v3 and they work fine. @Miraliu 鈥檚 suggestion seems sounds like it鈥檚 worth trying @a-c-sreedhar-reddy

I also had a break because of six, but upgrading my graphene-django to 2.8.0 fixed it for me. I also had to update another dependency.

@BossGrand you should still be able to import six since graphene-django has an explicit dependency on it: https://github.com/graphql-python/graphene-django/blob/master/setup.py#L59

V2 of Graphene Django still supports Python 2 so six is required.

Ah gotcha thanks @jkimbo will try again

upgrade graphql_jwt version to 0.3.0 verion, I had same problem and solved by run this command try
pip install "django-graphql-jwt>=0.3.0"

Was this page helpful?
0 / 5 - 0 ratings

Related issues

khankuan picture khankuan  路  4Comments

x9sheikh picture x9sheikh  路  4Comments

flame0 picture flame0  路  4Comments

eyalch picture eyalch  路  3Comments

nickhudkins picture nickhudkins  路  3Comments