您尚未登录。

#1 2021-01-19 09:51:54

布丁酱
Arch!Arch!Arch!
所在地: 成都
注册时间: 2020-07-27
帖子: 197
个人网站

pip更新失败

❯ sudo pip install pip                                                     ─╯
Looking in indexes: https://pypi.tuna.tsinghua.edu.cn/simple
ERROR: Exception:
Traceback (most recent call last):
  File "/usr/lib/python3.9/site-packages/pip/_internal/cli/base_command.py", line 228, in _main
    status = self.run(options, args)
  File "/usr/lib/python3.9/site-packages/pip/_internal/cli/req_command.py", line 182, in wrapper
    return func(self, options, args)
  File "/usr/lib/python3.9/site-packages/pip/_internal/commands/install.py", line 323, in run
    requirement_set = resolver.resolve(
  File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/legacy/resolver.py", line 183, in resolve
    discovered_reqs.extend(self._resolve_one(requirement_set, req))
  File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/legacy/resolver.py", line 388, in _resolve_one
    abstract_dist = self._get_abstract_dist_for(req_to_install)
  File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/legacy/resolver.py", line 331, in _get_abstract_dist_for
    skip_reason = self._check_skip_installed(req)
  File "/usr/lib/python3.9/site-packages/pip/_internal/resolution/legacy/resolver.py", line 236, in _check_skip_installed
    req_to_install.check_if_exists(self.use_user_site)
  File "/usr/lib/python3.9/site-packages/pip/_internal/req/req_install.py", line 438, in check_if_exists
    if not self.req.specifier.contains(existing_version, prereleases=True):
  File "/usr/lib/python3.9/site-packages/packaging/specifiers.py", line 790, in contains
    item = parse(item)
  File "/usr/lib/python3.9/site-packages/packaging/version.py", line 57, in parse
    return Version(version)
  File "/usr/lib/python3.9/site-packages/packaging/version.py", line 296, in __init__
    match = self._regex.search(version)
TypeError: expected string or bytes-like object
╭─   ~


布丁酱是菜鸡,没毛病,他是菜鸡:)

离线

#2 2021-01-19 16:34:26

luxni
会员
注册时间: 2014-06-08
帖子: 281

Re: pip更新失败

你不是安装仓库里的么?

extra/python-pip 20.2.4-1 [installed]
    The PyPA recommended tool for installing Python packages
extra/python2-pip 20.2.4-1 [installed]
    The PyPA recommended tool for installing Python packages

虽然人菜菜的,但也想做个有趣的人。

离线

#3 2021-01-19 17:01:32

依云
会员
所在地: a.k.a. 百合仙子
注册时间: 2011-08-21
帖子: 8,919
个人网站

Re: pip更新失败

不要 sudo pip!不要 sudo pip!不要 sudo pip!

离线

#4 2021-01-19 17:39:26

Mr.I
路人丙
所在地: Kerbal
注册时间: 2015-08-29
帖子: 308

Re: pip更新失败

不要 sudo pip +1,非 root 用户完全可以把所有的 Python 第三方库都装在 ~/.local/lib 里面,然后 pip 本身用 pacman 来管理,完美避免冲突 (虽然楼主的问题好像并不是冲突)

最近编辑记录 Mr.I (2021-01-19 17:40:46)

离线

页脚