赞
踩
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,保存退出即可.
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。