当前位置:   article > 正文

subprocess.CalledProcessError: Command ‘(‘lsb_release‘, ‘-a‘)‘ returned non-zero exit status 1._subprocess.calledprocesserror: command '('lsb_rele

subprocess.calledprocesserror: command '('lsb_release', '-a')' returned non-

ERROR: Exception:
Traceback (most recent call last):
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/base_command.py", line 180, in _main
    status = self.run(options, args)
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 204, in wrapper
    return func(self, options, args)
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/commands/install.py", line 269, in run
    session = self.get_default_session(options)
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 77, in get_default_session
    self._session = self.enter_context(self._build_session(options))
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/cli/req_command.py", line 87, in _build_session
    session = PipSession(
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/network/session.py", line 275, in __init__
    self.headers["User-Agent"] = user_agent()
  File "/usr/local/lib/python3.8/site-packages/pip/_internal/network/session.py", line 132, in user_agent
    linux_distribution = distro.linux_distribution()  # type: ignore
  File "/usr/local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 125, in linux_distribution
    return _distro.linux_distribution(full_distribution_name)
  File "/usr/local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 681, in linux_distribution
    self.version(),
  File "/usr/local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 741, in version
    self.lsb_release_attr('release'),
  File "/usr/local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 903, in lsb_release_attr
    return self._lsb_release_info.get(attribute, '')
  File "/usr/local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 556, in __get__
    ret = obj.__dict__[self._fname] = self._f(obj)
  File "/usr/local/lib/python3.8/site-packages/pip/_vendor/distro.py", line 1014, in _lsb_release_info
    stdout = subprocess.check_output(cmd, stderr=devnull)
  File "/usr/local/lib/python3.8/subprocess.py", line 415, in check_output
    return run(*popenargs, stdout=PIPE, timeout=timeout, check=True,
  File "/usr/local/lib/python3.8/subprocess.py", line 516, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1.

解决:

/usr/bin/lsb_release 编辑这个文件, 第一行改为python当前对应的版本,比如我的是3.8,那么就改为3.8,保存退出即可.

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/Cpp五条/article/detail/218840
推荐阅读
相关标签
  

闽ICP备14008679号