Reputation: 329
I tried removing my python2.7 and python3 folders from /usr/local/bin
by using a command:
sudo rm -rf python2.7
and
sudo rm -rf python3
Later my terminal is not opening. How can I fix it?
Upvotes: 3
Views: 39218
Reputation: 1295
GO to Setting -> Region & Language -> Login screen -> change language to English(United State) and restart
Before Change
Hope your issue fixed !!!
Upvotes: 0
Reputation: 864
In my case
sudo apt-get install language-pack-en-base
sudo dpkg-reconfigure locales
locale -a
export LC_ALL="en.utf-8"
sudo nano /etc/default/locale
and it shoud be
# File generated by update-locale
LANG="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
outherwise
sudo apt install dconf-cli
dconf reset -f /org/gnome/terminal
sudo apt-get remove gnome-terminal
sudo apt-get install gnome-terminal
sudo locale-gen --purge
sudo dpkg-reconfigure locales
reboot
Upvotes: 0
Reputation: 55
1 CTRL + ALT + F1
2 cp ~/.bashrc ~/.bashrc.bak
3 cp /etc/skel/.bashrc ~/
4 source ~/.bashrc
if terminal not working with CTRL + ALT + F1, try to change the content of .bashrc manually
Upvotes: 0
Reputation: 577
I was having the same issue when I updated python to 3.6 and selected alternative as python3.6, but when I reverted the option to the python3.5, terminal started working again:
sudo update-alternatives --config python3
The following message popped up:
There are 2 choices for the alternative python3 (providing /usr/bin/python3).
Selection Path Priority Status
------------------------------------------------------------
0 /usr/bin/python3.6 2 auto mode
* 1 /usr/bin/python3.5 1 manual mode
2 /usr/bin/python3.6 2 manual mode
Press <enter> to keep the current choice[*], or type selection number:
I selected 1
and it started working.
You can use Virtual Studio Code or any IDE to open it's internal Terminal and run the command to fix the common Terminal.
Upvotes: 9
Reputation: 11
I will list what caused my problem and how I fixed it.
Python version in my terminal was 2.7 and to upgrade it to 3+.
You might have got this message as well
Error while finding module specification for 'virtualenvwrapper.hook_loader' (ModuleNotFoundError: No module named 'virtualenvwrapper')
virtualenvwrapper.sh: There was a problem running the initialization hooks.
If Python could not import the module virtualenvwrapper.hook_loader,
check that virtualenvwrapper has been installed for
VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3 and that PATH is
set properly.
It didn't seem to have worked. Then terminal wasn't opening at all. After going through many stackoverflow answers I couldn't figure out. At the end let me tell what I did :
vi ~/.bashrc
# change version
export VIRTUALENVWRAPPER_PYTHON=/usr/bin/python3.6
source ~/.bashrc
sudo update-alternatives install /usr/bin/python python /usr/bin/python3.6 2
sudo update-alternatives --config python
The number 2 is user choice in my case there were two python versions. After executing both commands it will show a list of versions Select the python version from .bashrc file in auto mode
For me this worked!!!
Upvotes: 1
Reputation: 243
sudo apt-get update
.sudo apt-get dist-upgrade
.Upvotes: 3
Reputation: 762
You do not specify how deep your problem goes here. You also don't mention what you have already tried and which solutions do not work.
Ubuntu depends on Python, so removing it messes up with your system. When you force rm to remove Python, obviously you don't get a warning what the effects will be, but doing this in via apt
would have shown you. A similar issue is also discussed here.
Here there are some solutions:
chroot
dpkg
(bypassing APT, which requires Python). You can press Alt+F2 to run an application.sudo apt-get update
& sudo apt-get install --reinstall ubuntu-desktop
or sudo apt-get install --reinstall python2.7
.bashrc
as it is loaded every time you run the terminal.Upvotes: 4