Django-jet: ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' <DJANGO >= 3>

Created on 14 Jan 2021  路  2Comments  路  Source: geex-arts/django-jet

Hi!
I'm trying to use django-jet in my Django application in version 3.1, but I'm getting the following ERROR:

ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'

In:

File "/usr/local/lib/python3.8/site-packages/jet/models.py", line 3, in
from django.utils.encoding import python_2_unicode_compatible

I did some searching on the internet and found that this was removed in Django 3.0 or higher.

https://forum.djangoproject.com/t/importerror-cannot-import-name-python-2-unicode-compatible-from-django-utils-encoding/4336
https://stackoverflow.com/questions/59583726/django-importerror-cannot-import-name-python-2-unicode-compatible

Most helpful comment

Use the django3 version of Jet: pip install django-3-jet

All 2 comments

Use the django3 version of Jet: pip install django-3-jet

pip install six
replace django.utils with six

from six import python_2_unicode_compatible

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikolas310 picture nikolas310  路  4Comments

sysint64 picture sysint64  路  3Comments

leogout picture leogout  路  8Comments

jangeador picture jangeador  路  5Comments

erayerdin picture erayerdin  路  5Comments