chibisov / drf-extensions

DRF-extensions is a collection of custom extensions for Django REST Framework
http://chibisov.github.io/drf-extensions/docs
MIT License
1.48k stars 208 forks source link

Import error - Python 3.8: cannot import name 'six' from 'django.utils' #281

Closed edenmarcowizer closed 2 years ago

edenmarcowizer commented 4 years ago

Hi, I am using:

However, when I try to use the package, I get this error: File "/home/eden/project/venv3/lib/python3.8/site-packages/rest_framework_extensions/compat.py", line 7, in <module> from django.utils import six ImportError: cannot import name 'six' from 'django.utils' (/home/eden/project/venv3/lib/python3.8/site-packages/django/utils/__init__.py)

I believe this has something to do with the compatibility with python 3.8 since if I try to run work with python 3.6 it is working.

Is this an easy fix?

OskarPersson commented 4 years ago

Django 3 is not supported until a new release with #276 is created. However, looking at the whl from PyPi for 0.5.0 it seems like it isn't based on the 0.5.0 tag. It doesn't even match the source on PyPi. See mixins.py for example, it includes from django.utils import six which is deleted here: https://github.com/chibisov/drf-extensions/blob/0.5.0/rest_framework_extensions/mixins.py

@auvipy can you verify this?

OskarPersson commented 4 years ago

I think this might be a duplicate of https://github.com/chibisov/drf-extensions/issues/277

ruslankrivoshein commented 4 years ago

I think this might be a duplicate of #277

It is

afeezaziz commented 3 years ago

Hi I am facing this same problem but I am not sure why.

I check https://github.com/chibisov/drf-extensions/issues/277 and I tried to install directly from github but the same error pops up.