Score:6

Terminal not launching in Ubuntu 22.04

aw flag

For some reason, I can't open the terminal through the shortcut (terminal icon) in Ubuntu 22.04. It works through Visual Studio Code, though, so that makes me confused. I tried using the F keys, but they are only working to the fn functions (such as controlling the brightness). I am not very knowledgeable on how Ubuntu works, so I am terribly confused.

I did try (unsuccesfully) to change my python version to 3.11.

Edit: The contents of /usr/share/applications/org.gnome.Terminal.desktop:

[Desktop Entry]
Name=Terminal
Comment=Use the command line
Keywords=shell;prompt;command;commandline;cmd;
TryExec=gnome-terminal
Exec=gnome-terminal
Icon=org.gnome.Terminal
Type=Application
Categories=GNOME;GTK;System;TerminalEmulator;
StartupNotify=true
StartupWMClass=Gnome-terminal
X-GNOME-SingleWindow=false
OnlyShowIn=GNOME;Unity;
Actions=new-window;preferences;
X-Ubuntu-Gettext-Domain=gnome-terminal

[Desktop Action new-window]
Name=New Window
Exec=gnome-terminal --window

[Desktop Action preferences]
Name=Preferences
Exec=gnome-terminal --preferences
us flag
By any chance, did you change the default python version?
user480840 avatar
aw flag
oh, I mistook 'python' for 'linux'. I did try (unsuccesfully) to change my python version to 3.11;
user480840 avatar
aw flag
@ArchismanPanigrahi, do you know what the problem could be, given the new information?
us flag
Changing the default python version is bound to cause a lot of problems, for example see https://askubuntu.com/questions/1223013/i-accidentally-removed-python-from-ubuntu-graphical-interface-gone. If the already posted answer does not work for you, you will probably have to reinstall Ubuntu
ng flag
You should be able to open `xterm`. It's hideous by default but you should be able to make any changes you need.
us flag
Duplicate of https://askubuntu.com/questions/1397938/terminal-not-opening-after-changing-python-version/1397940#1397940
Score:9
zw flag

If you try to change your python version in a linux distro, it will most certainly cripple your environment. Python is an integral part and may not be changed under any circumstances. There are many questions & answers about it in this forum.

What could you do?

Depending on how you installed it, try to remove every remnant of your python 3.11.x and install the origin python from the repos.

Since you cannot open terminal, open a virtual terminal with ctrl + alt + f3 and login with your username and password.

If your "orignal" version was not removed, you may tell the system to use it again:

sudo update-alternatives --config python3

Select the Version 3.10.6, if provided. If that doesn't work, you'll have to reinstall your Ubuntu again.

What if you need another python version?

There are many possible ways to install any python version in a special environment like "pipenv", "anaconda", "venv", you name it. See here for a small overview of virtual environments.

The current python version in Ubuntu 22.04 ist 3.10.6 as of today.

user480840 avatar
aw flag
I changed it back to python 3.10 and it worked! thanks!
Zion Perez avatar
in flag
works! thank you!
Score:0
li flag

Had a similar issue, a youtube video resolved my case, without using any cmd line. Go to settings -> Language&Settings -> Change English (United States) to English (Canada) then restart.

Score:-1
cn flag

I had a similar issue. I tried a bunch of things everywhere. Here's what I eventually found that worked. It turned out when I updated python, it updated what gnome-terminal was set to. Here's what ya do:

Ctrl + Alt + F3, this will open a terminal

login

type sudo vim /usr/bin/gnome-terminal substitute vim for whatever editor you have if needed

check the comment at the top does it read #!/usr/bin/python3? If so, change it to the version you're using of python.

I was updating to 3.9 so I changed it to #!/usr/bin/python3.9. This fixed the issue and allowed me to open the terminal.

The issue was caused by when I updated python, for some reason it changed the gnome-terminal to just generically be python, instead of the python version I was actually using.

Esther avatar
es flag
generic "python3" is symlinked to the system version of Python. Updating your version of Python messed with *that*, not with the shebang in gnome terminal. Something is still very broken with your system if the programs that are included in the OS can't run using the default python. Follow the other answer here to fix it.
I sit in a Tesla and translated this thread with Ai:

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.