Skip to content
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

ImportError: cannot import name 'six' #366

Closed
ivanprjcts opened this issue Feb 7, 2019 · 15 comments
Closed

ImportError: cannot import name 'six' #366

ivanprjcts opened this issue Feb 7, 2019 · 15 comments

Comments

@ivanprjcts
Copy link

django.utils.six has been removed from django development version:

django/django@4138481

File "/usr/local/lib/python3.6/site-packages/corsheaders/init.py", line 1, in
from .checks import check_settings # noqa: F401
File "/usr/local/lib/python3.6/site-packages/corsheaders/checks.py", line 8, in
from django.utils import six
ImportError: cannot import name 'six'

@adamchainz
Copy link
Owner

That's removed in Django 3.0. django-cors-headers supports Django up until 2.1 right now. 2.2 is in alpha and will be supported by the time it is released. Presumably you're installing Django from its master branch, this is a bad idea and something that this third party package, and most others, will never support.

Basically, change to installing Django 2.1 from PyPI, and don't worry that issue will be fixed by the time Django 3.0 is released.

@shamanengine
Copy link

shamanengine commented Dec 3, 2019

and don't worry that issue will be fixed by the time Django 3.0 is released.

Probably not +))

@hanshendrickx
Copy link

I have the same problem! How to fix this?

@adamchainz
Copy link
Owner

Please upgrade to the latest version. It is fully tested with Django 3.0. If you’re still having errors there open a new issue with the exact trace back. Thanks.

@Mayank-21
Copy link

Mayank-21 commented Dec 5, 2019

I am also getting same error today after udgrading version of django to 3.0.0. Any idea how to solve it ?
I am currently using python 3.7.5 version with djanog 3.0.0.

I have checked in folder Lib\site-packages\django\utils and not found and six.py file but still from Lib\site-packages\jsonfield\encode.py containing line from django.utils import six, timezone which trying to import six but not able to find.

@adamchainz
Copy link
Owner

What version of Django-cors-headers are you using?

@ztolley
Copy link

ztolley commented Dec 5, 2019

Having same issue, using django-cors-headers version 3.2.0

@adamchainz
Copy link
Owner

@ztolley with exactly the same trace back? 3.2.0 shouldn’t be importing six.

@ztolley
Copy link

ztolley commented Dec 5, 2019

Done more investigation, I think the problem actually comes from graphene-django.
Soz

@DaffyTheDuck
Copy link

Any update on that ?

Having the same error

@adamchainz
Copy link
Owner

@IAmAMissingColon #366 (comment)

@Aminujb
Copy link

Aminujb commented Dec 9, 2019

Done more investigation, I think the problem actually comes from graphene-django.
Soz

Hello, have you been able to resolve the error?
If yes please help.

@wiwek13
Copy link

wiwek13 commented Dec 16, 2019

same issue

@baermathias
Copy link

There are several 3rd party packages, which use six and are now broken with Django 3.0 release. One way to solve the problem is to install six directly:

pipenv install six

Then identify the file, which uses six from django.utils (it is the last line before the error message, for me it was django_registration/validators.py) and change it from:

from django.utils import six

to:

import six

@adamchainz
Copy link
Owner

@baermathias your suggestion is dangerous. Don't edit the files in your installed packages.

Also please don't discuss packages other than django-cors-headers on this issue tracker.

@wiwek13 upgrade django-cors-headers. If the problem is another package, check there.

I'm locking this issue due to going off topic.

@adamchainz adamchainz reopened this Dec 18, 2019
Repository owner locked as off-topic and limited conversation to collaborators Dec 18, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants