django-mailbox
django-mailbox copied to clipboard
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'
django-mailbox==4.8.1
When running python manage.py migrate django_mailbox
after installation and adding django_mailbox to INSTALLED_APPS, this error is returned
python manage.py migrate django_mailbox
Traceback (most recent call last):
File "manage.py", line 24, in <module>
main()
File "manage.py", line 20, in main
execute_from_command_line(sys.argv)
File "/Users/joseph.peterson/Development/help-desk/env-helpdesk/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/Users/joseph.peterson/Development/help-desk/env-helpdesk/lib/python3.7/site-packages/django/core/management/__init__.py", line 377, in execute
django.setup()
File "/Users/joseph.peterson/Development/help-desk/env-helpdesk/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/joseph.peterson/Development/help-desk/env-helpdesk/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/Users/joseph.peterson/Development/help-desk/env-helpdesk/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/Users/joseph.peterson/Development/help-desk/env-helpdesk/lib/python3.7/importlib/__init__.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "<frozen importlib._bootstrap>", line 1006, in _gcd_import
File "<frozen importlib._bootstrap>", line 983, in _find_and_load
File "<frozen importlib._bootstrap>", line 967, in _find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 677, in _load_unlocked
File "<frozen importlib._bootstrap_external>", line 728, in exec_module
File "<frozen importlib._bootstrap>", line 219, in _call_with_frames_removed
File "/Users/joseph.peterson/Development/help-desk/env-helpdesk/lib/python3.7/site-packages/django_mailbox/models.py", line 31, in <module>
from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'
Which version of django?
Fixed in https://github.com/coddingtonbear/django-mailbox/commit/2b2b7d639236ecf615ffa510441f2163bb6de4a6 . Not released yet.
Which version of django?
Fixed in 2b2b7d6 . Not released yet.
Django==3.0.2 Does it need to be downgraded in the meantime?
The project is based on the work of volunteers who do not any receive payments for the development of django-mailbox. Instead of going back to previous version Django, I suggests joining to us and taking all necessary steps to preapre a new release (write changelog etc.), which will be a good first step to become a contributor of the project.
@jscpeterson I installed via cloning the git repository instead of using pip which solved the problem you have here.
I can confirm this for 4.8.1 when i install it via pip directly or with git from pip. Installation with pip3 install git+https://github.com/coddingtonbear/django-mailbox.git@c8751f0c9ae85e43f8e775e21dc5ad26adc7f459 it works.
Yes, installing the latest version from git solves the problem for me.
Fixed with the last release (maybe even before)