- 今天用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
,结果就可以了