首页 > 解决方案 > 从 django.utils.encoding 导入 python_2_unicode_compatible ImportError: cannot import name 'python_2_unicode_compatible'

问题描述

当我尝试使该站点以 SSH 运行时。我收到此错误

File "/home/new_env/lib/python3.6/site-packages/rest_framework/authtoken/models.py", line 6, in <module>
    from django.utils.encoding import python_2_unicode_compatible
ImportError: cannot import name 'python_2_unicode_compatible'

我最近将 django 版本从 2.1 t0 3.0.7

标签: pythondjango

解决方案


推荐阅读