I updated my system (Ubuntu 18.04) from Python 3.6 to Python 3.8, and reset the defaults so that python3 now points to Python 3.8 (and not 3.6). However, since then, the terminal has refused to open using Ctrl + Alt + T, and other obvious methods such as clicking on the icon itself.
When I run gnome-terminal
- I get the following:
usernew@HP:/usr/lib/python3/dist-packages/gi$ 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 partially initialized module 'gi' (most likely due to a circular import) (/usr/lib/python3/dist-packages/gi/__init__.py)
I don't know what this means but I guess it definitely points to the fact that something went wrong during the update. I understand that there are other existing threads on similar issues, but most of them were about updating from Python2 to Python3, so I'm not sure if they're relevant.
Could someone help, please?
Important Update:
So, after reading this answer - I changed the gnome-terminal
script's first line to #!/usr/bin/python3.6
instead of #!/usr/bin/python3.8
- and that solves the problem.
Also, when I type python3
in the terminal, I'm greeted with Python 3.8.2, as desired.
The question remains - Why did this work? What was the actual problem? An explanation would help, so I really know what I'm doing.
Thanks!