当我想切换到 python 3.8 时,看起来我已经破坏了 python 安装。使用 Ubuntu 18.04。尝试使用 gi
,出现以下错误:
$ python
Python 3.8.1 (default, Dec 31 2019, 18:42:42)
[GCC 7.4.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from gi.repository import GLib, Gio
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
from . import _gi
ImportError: cannot import name '_gi' from partially initialized module 'gi' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gi/__init__.py)
尝试为 python 运行 update-alternatives,但它告诉我只配置了一个 python 替代方案 (3.8)。
试图重新安装 python3-gi 和 python3.8。还是一样的问题
原文由 user3111525 发布,翻译遵循 CC BY-SA 4.0 许可协议
我遇到过同样的问题。我将 python3 链接到 python3.6,对我来说它指向 3.8。那解决了这个问题。
就这样。现在我的系统开始正常工作了。