(pip 安装出错)AttributeError: type object ‘_CleanResult‘ has no attribute ‘from_link

  • 今天用pip安装库,本来pip的版本是21.1.2,用着没啥问题
  • 刚才显式可以升级到21.2.2,于是就顺手升级了一下,结果就报下面的问题了:
ERROR: Exception:
Traceback (most recent call last):
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
    status = self.run(options, args)
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 203, in wrapper
    return func(self, options, args)
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 316, in run
    reqs, check_supported_wheels=not options.target_dir
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
    collected.requirements, max_rounds=try_to_avoid_resolution_too_deep
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 472, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 341, in resolve
    self._add_to_criteria(self.state.criteria, r, parent=None)
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 168, in _add_to_criteria
    candidates=build_iter_view(matches),
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_vendor/resolvelib/structs.py", line 164, in build_iter_view
    matches = list(matches)
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 417, in <genexpr>
    and all(req.is_satisfied_by(c) for req in requirements[identifier])
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 417, in <genexpr>
    and all(req.is_satisfied_by(c) for req in requirements[identifier])
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/requirements.py", line 39, in is_satisfied_by
    return candidate == self.candidate
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 172, in __eq__
    return links_equivalent(self._link, other._link)
  File "/home/SWHL/anaconda3/envs/demo/lib/python3.6/site-packages/pip/_internal/models/link.py", line 288, in links_equivalent
    return _CleanResult.from_link(link1) == _CleanResult.from_link(link2)
AttributeError: type object '_CleanResult' has no attribute 'from_link
  • 网上搜了一圈,没找到具体原因,尝试将pip重新安装到21.1.2,结果就可以了
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值