gpt4 book ai didi

Django-ads-txt causing ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'(导致ImportError的django-ads-txt:无法从‘django.utils.coding’导入名称‘python_2_unicode_compatible’)

转载 作者:bug小助手 更新时间:2023-10-25 22:46:32 26 4
gpt4 key购买 nike



Hi I trying to Install django-ads-txt to my Django Project.

嗨,我试图安装django-ads-txt到我的django项目。


My first step was to pip install django-ads-txt then I added in the urls path('ads.txt', include('ads_txt.urls')), when I tried to python manage.py migrate I got the following error:

我的第一步是通过pip安装django-ads-txt,然后添加URL路径(‘ads.txt’,Include(‘ads_txt.urls’)),当我尝试执行python Manage.py迁移时,收到以下错误:


from django.utils.encoding import python_2_unicode_compatible

ImportError: cannot import name 'python_2_unicode_compatible' from 'django.utils.encoding'

I tried to pip install six but the same error kept showing

我试图通过PIP安装6个,但同样的错误一直显示


My question: How to fix this error to install django-ads-txt?

我的问题是:如何修复这个错误以安装django-ads-txt?


更多回答

looks like github.com/flyingelephantlab/django-ads-txt has not been updated in 4+ years, you will most likely need to downgrade your python/django versions to be compatible

看起来githorb.com/flyingevphantlab/django-ads-txt已经4年多没有更新了,你很可能需要降级你的python/django版本才能兼容

优秀答案推荐
更多回答

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com