执行python manage.py runserver时报错
解决方法:
1.python -m pip install six
2.进入python/site-packages
cd /home/“你的用户名”/anaconda3/envs/myenv/lib/python3.10/site-packages
3.将six.py 复制到 site-packages/django/utils就可以
类似的错误:
django.template.library.InvalidTemplateLibrary: Invalid template library specified. ImportError raised when trying to load 'bootstrap3.templatetags.bootstrap3': cannot import name 'force_text' from 'django.utils.encoding'
解决方案参考:
force_text is removed from Django 4.0
You can add this code to top of your settings.py :
import django
from django.utils.encoding import force_str
django.utils.encoding.force_text = force_str