运行 Bpython 时遇到问题

运行 Bpython 时遇到问题

我使用sudo apt-get install bpython命令安装bpython。现在,当我输入 时bpython,出现错误:

Traceback (most recent call last):
File "/usr/bin/bpython", line 5, in <module>
from pkg_resources import load_entry_point
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 2749, in <module>
working_set = WorkingSet._build_master()
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 444, in _build_master
ws.require(__requires__)
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 725, in require
needed = self.resolve(parse_requirements(requirements))
File "/usr/lib/python3/dist-packages/pkg_resources.py", line 628, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: bpython==0.12

答案1

简短的答案是从包中卸载sudo apt-get remove bpython并通过 pip: 安装sudo pip install bpython

我认为发生的事情是 bpython 包假定 python 2.7 in /usr/bin/python,但从回溯来看,你的/usr/bin/python似乎是 python3。

要验证,请尝试运行/usr/bin/python -V以查看版本并与dpkg -L bpython您可能会看到类似内容的输出进行比较:/usr/lib/python2.7/dist-packages/bpython/args.py

如果情况确实如此,那么,是的,您可能还想向发行版维护人员报告此情况,以便他们可以修复该软件包。

相关内容