I'm trying to add a repository to ppa with the add-apt-repository
commands but the _gi
module from Python is not found.
I did this command : sudo add-apt-repository ppa:s-mankowski/ppa-kf5
Here is the traceback :
Traceback (most recent call last):
File "/usr/bin/add-apt-repository", line 11, in <module>
from softwareproperties.SoftwareProperties import SoftwareProperties, shortcut_handler
File "/usr/lib/python3/dist-packages/softwareproperties/SoftwareProperties.py", line 67, in <module>
from gi.repository import Gio
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
from . import _gi
ImportError: cannot import name '_gi' from 'gi' (/usr/lib/python3/dist-packages/gi/__init__.py)
I'm on Ubuntu with Python3.7, I tried many solutions like but it doesn't work :
$ cd /usr/lib/python3/dist-packages
$ sudo ln -s apt_pkg.cpython-{36m,37m}-x86_64-linux-gnu.so
$ cd /usr/lib/python3/dist-packages/gi
$ sudo ln -s _gi.cpython-{36m,37m}-x86_64-linux-gnu.so
I can't use the sudo add-apt-repository ppa:s-mankowski/ppa-kf5
command but running a Python file with python3 {file}
works.
Thanks for the help !
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…