相关疑难解决方法(0)

从“django.utils.encoding”导入错误“force_text”

我正在使用 python、graphene 和 django 实现 graphql 解决方案,但出现以下导入错误:

Result: Failure Exception: ImportError: cannot import name 'force_text' from 'django.utils.encoding'

"/home/site/wwwroot/.python_packages/lib/site-packages/graphene_django/utils/utils.py", line 6, in <module> from django.utils.encoding import force_text
Run Code Online (Sandbox Code Playgroud)

我不确定版本以及是否需要导入额外的模块。我的requirements.txt是这样的:

graphene>=2.1,<3
graphene-django>=2.1,<3
graphql-core>=2.1,<3
graphql-relay==2.0.1
django-filter>=2
Run Code Online (Sandbox Code Playgroud)

有人遇到过类似的问题吗?可以看看我使用的版本吗?谢谢

python django python-3.x graphql graphene-django

50
推荐指数
4
解决办法
6万
查看次数

标签 统计

django ×1

graphene-django ×1

graphql ×1

python ×1

python-3.x ×1