Using gedit-plugins in Python virtual environments

I’ve not found a solution to this issue, but I thought I should share a workaround in case others encounter this issue. Two workarounds, in fact, but the first one is unsatisfactory in my opinion:

  1. Install PyGObject in the virtual environment and disable the File Browser Plugin in gedit, as mentioned in my original post.

  2. Install Vext in the virtual environment. It is a Python package, available on PyPI, that makes it possible to access certain system-wide packages from within a virtual environment. In this case, we want to access the system-wide gi package, so we install vext.gi in the virtual environment:

    pip3 install vext.gi
    

    After installation, run vext --check gi.vext to test that the import gi.repository statement works. See vext --help for more options.

    The miscommunication reported between the Git and the File Browser plugins doesn’t appear to occur when using Vext.