gpt4 book ai didi

python - 属性错误 : 'NoneType' object has no attribute 'excluded_of'

转载 作者:行者123 更新时间:2023-12-03 15:53:59 25 4
gpt4 key购买 nike

通过 pip 安装依赖项时出现属性错误

Traceback (most recent call last):
File "/home/jpg/.virtual_env/cloud/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 210, in _main
status = self.run(options, args)
File "/home/jpg/.virtual_env/cloud/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 180, in wrapper
return func(self, options, args)
File "/home/jpg/.virtual_env/cloud/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 319, in run
reqs, check_supported_wheels=not options.target_dir
File "/home/jpg/.virtual_env/cloud/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 122, in resolve
requirements, max_rounds=try_to_avoid_resolution_too_deep,
File "/home/jpg/.virtual_env/cloud/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 445, in resolve
state = resolution.resolve(requirements, max_rounds=max_rounds)
File "/home/jpg/.virtual_env/cloud/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 344, in resolve
success = self._backtrack()
File "/home/jpg/.virtual_env/cloud/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 287, in _backtrack
criterion = self.state.criteria[name].excluded_of([candidate])
AttributeError: 'NoneType' object has no attribute 'excluded_of'
我的 requirements.txt看起来像
celery==5.0.2
billiard<4.0,>=3.6.0
redis==3.5.3
redis-log-handler==0.0.1.dev32

最佳答案

更新 - 1 (on 2020-12-27)
该问题已在 中得到修复pip==20.3.3 因此您不会收到此异常。
但是,(这里)redis-log-handler==0.0.1.dev32取决于 redis==3.0.1但是,你有 redis==3.5.3在 requirements.txt 以及依赖项上 不会解决 .所以,你会进一步收到一个错误(我会说,一个验证错误),

ERROR: Cannot install -r requirements.txt (line 4) and redis==3.5.3because these package versions have conflicting dependencies.

The conflict is caused by:The user requested redis==3.5.3redis-log-handler 0.0.1.dev32 depends on redis==3.0.1

To fix this you could try to:

  1. loosen the range of package versions you've specified
  2. remove package versions to allow pip attempt to solve the dependency conflict

这个错误报告非常有用,是时候调整你的包依赖了。
注:如果您对调整依赖项不感兴趣并想像以前一样解决它,请阅读以下部分

原帖
这是 pip version 20.3 的问题并且还没有固定在 pip==20.3.3 .
方法一
通过以下方式安装以前稳定版本的 pip (20.2.X),
pip install --upgrade pip~=20.2.0
方法二
使用 --use-deprecated 标志同时 安装要求
pip install -r requirements.txt --use-deprecated=legacy-resolver

关于python - 属性错误 : 'NoneType' object has no attribute 'excluded_of' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65085051/

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