cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'
Closed this issue · 1 comments
brianedelman commented
I am running django 3.0.10 and python 3.7 and receive this after installing library
File "./manage.py", line 17, in <module>
execute_from_command_line(sys.argv)
File "/Users/me/.virtualenvs/atriahealth/lib/python3.7/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
utility.execute()
File "/Users/me/.virtualenvs/atriahealth/lib/python3.7/site-packages/django/core/management/__init__.py", line 377, in execute
django.setup()
File "/Users/me/.virtualenvs/atriahealth/lib/python3.7/site-packages/django/__init__.py", line 24, in setup
apps.populate(settings.INSTALLED_APPS)
File "/Users/me/.virtualenvs/atriahealth/lib/python3.7/site-packages/django/apps/registry.py", line 114, in populate
app_config.import_models()
File "/Users/me/.virtualenvs/atriahealth/lib/python3.7/site-packages/django/apps/config.py", line 211, in import_models
self.models_module = import_module(models_module_name)
File "/Users/me/.pyenv/versions/3.7.7/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/me/.virtualenvs/atriahealth/lib/python3.7/site-packages/django_twilio/models.py", line 4, in <module>
from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding' (/Users/me/.virtualenvs/atriahealth/lib/python3.7/site-packages/django/utils/encoding.py)```
That method was moved to six in django 3 https://docs.djangoproject.com/en/3.0/releases/3.0/#removed-private-python-2-compatibility-apis
brianedelman commented
Closing. I had an old version :(