我昨天安装了Python3,但我觉得我做得不太好:
:~$ gnome-terminal
Traceback (most recent call last):
File "/usr/bin/gnome-terminal", line 9, in
from gi.repository import GLib, Gio
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in
from . import _gi
ImportError: cannot import name '_gi' from 'gi' (/usr/lib/python3/dist-packages/gi/__init__.py)
在尝试删除PPA (在404中)时,我得到了相同的错误:
add-apt-repository --remove ppa:/jonathonf/python-3.7
然而,Python运行得很顺利。这也可能有帮助:
~$ python --version
Python 2.7.15rc1
~$ python3 --version
Python 3.7.0b3
~$ type -a python3; file $(type -aP python3)
python3 is /usr/bin/python3
/usr/bin/python3: symbolic link to /etc/alternatives/python3
~$ python3.5 --version # Expected, I installed 3.6 and 3.7 - I only added the 3.5 link as a following desperate attempt
bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
~$ python3.6 --version
Python 3.6.5
~$ python3.7 --version
Python 3.7.0b3
运行Ubuntu 18.04
重新安装gnome-terminal
后,错误仍然存在.我发现这个职位没有答案,但是他们建议重新安装Ubuntu,比如,我希望他们是在开玩笑。
发布于 2018-07-31 22:16:59
你遵循的指令中的步骤3是错误的。Python 3的不同版本不是替代品。谢天谢地,这应该很容易解决。只需使用与文章底部的更新中类似的命令:
sudo rm /usr/bin/python3
sudo ln -s python3.6 /usr/bin/python3
https://askubuntu.com/questions/1061206
复制相似问题