Ubuntu16.04 python3.5-3.6后终端无法启动

转载

本来默认的python版本是2.7, 改为3.6后, 就出现gnome-terminal用不了的问题:

$ gnome-terminal
Traceback (most recent call last):
  File "/usr/bin/gnome-terminal", line 9, in
    from gi.repository import GLib, Gio
  File "/usr/lib/python3/dist-packages/gi/__init__.py", line 42, in
    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/jaket5219999/article/details/78465251

你可能感兴趣的:(Ubuntu16.04 python3.5-3.6后终端无法启动)