安装Python3之后,出现这个错误:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 |
Exception: Traceback (most recent call last): File "/usr/local/python3/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 143, in main status = self.run(options, args) File "/usr/local/python3/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 259, in run with self._build_session(options) as session: File "/usr/local/python3/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 79, in _build_session insecure_hosts=options.trusted_hosts, File "/usr/local/python3/lib/python3.6/site-packages/pip/_internal/download.py", line 337, in __init__ self.headers["User-Agent"] = user_agent() File "/usr/local/python3/lib/python3.6/site-packages/pip/_internal/download.py", line 100, in user_agent zip(["name", "version", "id"], distro.linux_distribution()), File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 120, in linux_distribution return _distro.linux_distribution(full_distribution_name) File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 675, in linux_distribution self.version(), File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 735, in version self.lsb_release_attr('release'), File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 892, in lsb_release_attr return self._lsb_release_info.get(attribute, '') File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 550, in __get__ ret = obj.__dict__[self._fname] = self._f(obj) File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 998, in _lsb_release_info stdout = subprocess.check_output(cmd, stderr=devnull) File "/usr/local/python3/lib/python3.6/subprocess.py", line 356, in check_output **kwargs).stdout File "/usr/local/python3/lib/python3.6/subprocess.py", line 438, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1. Traceback (most recent call last): File "/usr/bin/pip3", line 11, in <module> sys.exit(main()) File "/usr/local/python3/lib/python3.6/site-packages/pip/_internal/__init__.py", line 78, in main return command.main(cmd_args) File "/usr/local/python3/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 184, in main timeout=min(5, options.timeout) File "/usr/local/python3/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 79, in _build_session insecure_hosts=options.trusted_hosts, File "/usr/local/python3/lib/python3.6/site-packages/pip/_internal/download.py", line 337, in __init__ self.headers["User-Agent"] = user_agent() File "/usr/local/python3/lib/python3.6/site-packages/pip/_internal/download.py", line 100, in user_agent zip(["name", "version", "id"], distro.linux_distribution()), File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 120, in linux_distribution return _distro.linux_distribution(full_distribution_name) File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 675, in linux_distribution self.version(), File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 735, in version self.lsb_release_attr('release'), File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 892, in lsb_release_attr return self._lsb_release_info.get(attribute, '') File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 550, in __get__ ret = obj.__dict__[self._fname] = self._f(obj) File "/usr/local/python3/lib/python3.6/site-packages/pip/_vendor/distro.py", line 998, in _lsb_release_info stdout = subprocess.check_output(cmd, stderr=devnull) File "/usr/local/python3/lib/python3.6/subprocess.py", line 356, in check_output **kwargs).stdout File "/usr/local/python3/lib/python3.6/subprocess.py", line 438, in run output=stdout, stderr=stderr) subprocess.CalledProcessError: Command '('lsb_release', '-a')' returned non-zero exit status 1. |
解决方法:
sudo mv /usr/bin/lsb_release /usr/bin/lsb_release_back
本文最后更新于2023年5月10日,已超过 1 年没有更新,如果文章内容或图片资源失效,请留言反馈,我们会及时处理,谢谢!
如何解决
怎么解决?
???啊?
向楼主学习一下
向楼主学习一下
想了解原因,得到解决方案
想了解一下到底是什么原因。
这个问题很多人遇到过,希望能够帮助到大家