0

(Sorry I'm new at this so I apologize if the question isn't worded well)

I tried to run python manage.py runserver after setting up for a project without error, however it wasn't successful and it displayed the following error: ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'.

In response to the error, I tried to use use a separate command to import: from django.utils.encoding import python_unicode_compatible . However, this gave an error as well: from: can't read /var/mail/django.utils.encoding.

Might anyone know what this error means and what I may do to fix it? Thank you so much!

1 Answers1

0

try

from django.utils.six import python_2_unicode_compatible

instead of

from django.utils.encoding import python_2_unicode_compatible
  • It resulted in a similar error sadly: `from: can't read /var/mail/django.utils.six`. Not sure if this is crucial info, but I'm working in a mac terminal instead of writing a python script - would that make a difference? Thank you so much for your help!! – itssohardtocomeupwithusernames Mar 27 '20 at 16:55
  • That's a separate problem; you need this in your Python file, not in your shell. – tripleee Jun 13 '22 at 05:14