python - 使用最新的石墨烯和石墨烯-django 版本时导入(无法从“graphql”导入名称“ResolveInfo”)错误
问题描述
自从更新我的依赖项后,我的 django 应用程序出现了一些问题。这是我安装的应用程序:
INSTALLED_APPS = [
'graphene_django',
'rest_framework',
'corsheaders',
'django.contrib.admin',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.messages',
'django.contrib.staticfiles',
'dojo_manager.dojo',
]
和我的 requirements.txt:
aniso8601==8.0.0
asgiref==3.2.3
Django==3.0.2
django-cors-headers==3.2.0
django-filter==2.2.0
django-graphql-jwt==0.3.0
djangorestframework==3.11.0
djangorestframework-jwt==1.11.0
graphene==2.1.8
graphene-django==2.8.0
graphene-django-extras==0.4.8
graphql-core==3.0.1
graphql-relay==3.0.0
pip-upgrade-outdated==1.5
pipupgrade==1.5.2
promise==2.3
PyJWT==1.7.1
python-dateutil==2.8.1
pytz==2019.3
Rx==3.0.1
singledispatch==3.4.0.3
six==1.13.0
sqlparse==0.3.0
我正进入(状态
ImportError: cannot import name 'ResolveInfo' from 'graphql' (E:\Ben\GitHub-Repos\dojo-manager\env\lib\site-packages\graphql\__init__.py)
我知道https://github.com/graphql-python/graphene-django/issues/737和https://github.com/graphql-python/graphene/issues/546,似乎都没有解决它我的情况。
非常感谢任何帮助。
解决方案
好的,我能够通过降级graphql-core==3.0.1
到graphql-core<3
(以及所有依赖项)来修复它。
我一定是在执行时错过了错误pip install -r requirements.txt
推荐阅读
- docker - 如何在图像的预定义入口点上传递参数?
- ios - 如何检测哪个 UICollectionView 滚动了?
- python - 通过python合并两个exe文件
- katalon - Web 中的后台脚本执行 - Katalon
- clojure - 为什么这个关键字函数查找在 hashmap 中不起作用?
- error-handling - Rust Snafu Crate: no method named `fail` found for enum `Error` in the current scope
- angular - 如何创建组合来自两个不同功能模块的数据的 NGRX 选择器?
- react-native - React 本机模式的行为不符合预期
- java - 如何保存和恢复用户看到的最后一个图像视图?
- c# - 如何使用访问 List 类型的所有行
在 C# .NET 框架中?