ImportError: cannot import name '_gi'

已邀请:

ncnynl

赞同来自:

装了python2.7.13, 之后陆续装了python3.5.3, python3.6.1

本来默认的python版本是2.7, 改为3.6后, 就出现gnome-terminal用不了的问题:
$ gnome-terminal
Traceback (most recent call last):
File "/usr/bin/gnome-terminal", line 9, in <module>
from gi.repository import GLib, Gio
File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in <module>
from . import _gi
ImportError: cannot import name '_gi'
 
$ ls /usr/lib/python3/dist-packages/gi/
_constants.py _gobject overrides _signalhelper.py
docstring.py importer.py _propertyhelper.py types.py
_error.py __init__.py __pycache__
_gi_cairo.cpython-35m-x86_64-linux-gnu.so module.py pygtkcompat.py
_gi.cpython-35m-x86_64-linux-gnu.so _option.py repository
 
$ sudo cp _gi.cpython-35m-x86_64-linux-gnu.so _gi.cpython-36m-x86_64-linux-gnu.so
$ sudo cp _gi_cairo.cpython-35m-x86_64-linux-gnu.so _gi_cairo.cpython-36m-x86_64-linux-gnu.so


原文链接:https://blog.csdn.net/jaket521 ... 65251

要回复问题请先登录注册