Score:0

Terminal, settings and other system applications don't open in ubuntu 20.04

ve flag

I use ubuntu 20.04 and can't open terminal, settings, software updater, and ... I had to use my vscode terminal instead.

before installing Django and python3.9, I hadn't this issue. I think something is wrong with python on my computer.

Here are the errors I get:

error1: when I run sudo apt do-release-upgrade in my vscode terminal:

Traceback (most recent call last):

File "/usr/bin/do-release-upgrade", line 11, in <module>
    from UpdateManager.Core.MetaRelease import MetaReleaseCore
  File "/usr/lib/python3/dist-packages/UpdateManager/Core/MetaRelease.py", line 25, in <module>
    import apt
  File "/usr/lib/python3/dist-packages/apt/__init__.py", line 23, in <module>
    import apt_pkg
ModuleNotFoundError: No module named 'apt_pkg'

error2: and when I run gnome-terminal in my vscode 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)

when I want to run applications from GUI, no error is shown. and can't open the application.

I want to upgrade to ubuntu 21.04 and have my Python/Django projects save

Update once I change the Python version to 3.8 and couldn't run my Python and Django projects

Score:0
cn flag

You apparently considered changing the default python version of your Ubuntu system. That does not work. Python is deeply used for the desktop. Changing your default Python version may break your system.

Restore the system Python version and prefer to use tools like Anaconda instead if you need different Python environments for development purposes.

Mahdi Jafari avatar
ve flag
how can I change default python?
vanadium avatar
cn flag
Undo what you now did.
Mahdi Jafari avatar
ve flag
It is about 2 months that I installed python3.9 and Django and made changes to my system. now I don't know what has been changed and what is going on. could you help me?
ChanganAuto avatar
us flag
There are ways to install different python versions and have them co-exist without changing the default version which is required for the system.
vanadium avatar
cn flag
@MahdiJafari I do not know as such, but you will likely find ways here on the site. Otherwise, you can open a question here like "How can I revert to the default python version of my Ubuntu installation". You could also open a different question, if not yet available, on how to install different versions of python without affecting your default version.
Mahdi Jafari avatar
ve flag
@vanadium Thanks a lot
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.