[Python] ImportError: cannot import name '_gi' from partially initialized module 'gi' (most...

Discussão em 'Python' iniciado por Stack, Dezembro 6, 2024.

  1. Stack

    Stack Membro Participativo

    Looks like I have broken my python installation when I wanted to switch to python 3.8. Using Ubuntu 18.04. Trying to use the gi, gives the following error:

    $ 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)


    Tried running update-alternatives for python, but it tells me there is only one python alternative configured (3.8).

    Tried to reinstall python3-gi and python3.8. Still the same problem

    Continue reading...

Compartilhe esta Página