I installed Python3 yesterday, but I have the feeling I didn't do a good job:
:~$ 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' from 'gi' (/usr/lib/python3/dist-packages/gi/__init__.py)
I get the same error when trying to remove the PPA (in 404) with:
add-apt-repository --remove ppa:/jonathonf/python-3.7
And yet, Python runs smoothly. This might be helpful too:
~$ python --version
Python 2.7.15rc1
~$ python3 --version
Python 3.7.0b3
~$ type -a python3; file $(type -aP python3)
python3 is /usr/bin/python3
/usr/bin/python3: symbolic link to /etc/alternatives/python3
~$ python3.5 --version # Expected, I installed 3.6 and 3.7 - I only added the 3.5 link as a following desperate attempt
bash: /usr/lib/command-not-found: /usr/bin/python3: bad interpreter: No such file or directory
~$ python3.6 --version
Python 3.6.5
~$ python3.7 --version
Python 3.7.0b3
Running Ubuntu 18.04
The error persists after re-installing gnome-terminal
. I've found this post that doesn't have an answer, but they suggest to re-install Ubuntu, like, I hope they're joking (:
python3
must point to the version of Python 3 that came with Ubuntu (and that is Python 3.6 or lower for any current Ubuntu release). Runtype -a python3; file $(type -aP python3)
and that will give us more info about your current setup. – wjandrea Jul 31 '18 at 19:26ln -s apt_pkg.cpython-{35m,34m}-x86_64-linux-gnu.so; ln -s apt_pkg.cpython-{36m,37m}-x86_64-linux-gnu.so
– ecoologic Jul 31 '18 at 22:04