Import issues with python_2_unicode_compatible
See original GitHub issueDjango = 3.1.1 django-auditlog = 0.4.7
Error Messages:
redacted\lib\site-packages\auditlog\registry.py", line 5, in <module> from django.utils.six import iteritems ModuleNotFoundError: No module named ‘django.utils.six’
Fixed by installing django-utils-six ~= 2.0
pip install django-utils-six
redacted\lib\site-packages\auditlog\models.py", line 13, in <module> from django.utils.encoding import python_2_unicode_compatible, smart_text ImportError: cannot import name ‘python_2_unicode_compatible’ from ‘django.utils.encoding’ (redacted\lib\site-packages\django\utils\encoding.py)
and
replace:
from django.utils.encoding import python_2_unicode_compatible
with:
from six import python_2_unicode_compatible
Issue Analytics
- State:
- Created 3 years ago
- Reactions:4
- Comments:7 (1 by maintainers)
Top Results From Across the Web
python - python_2_unicode_compatible error - Stack Overflow
I have founded same problem : from django.utils.encoding import python_2_unicode_compatible ImportError: cannot import name ...
Read more >cannot import name 'python_2_unicode_compatible ... - GitHub
Hi, I am running python 3.8, django 3 and django-auditlog 0.4.5 (latest pip and PyCharm know about). When I try to do a...
Read more >python_2_unicode_compatible error - Google Groups
I've "models.py" as follows, #encoding: utf-8 from django.contrib.auth.models import User from django.db import models
Read more >cannot import name 'python_2_unicode_compatible' from ...
but I'm facing an error when I migrate my models, from django.utils.encoding import python_2_unicode_compatible ImportError: cannot import ...
Read more >cannot import name 'python_2_unicode_compatible' - YouTube
Django : Django ImportError: cannot import name ... If there any issues, contact us on - htfyc dot hows dot tech ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
use django-auditlog==1.0a1
On further checking, the current branch doesn’t include references to django.utils.six Installing from pip however still brings the fault