Earlier, my default Python version was python2.7
.
To upgrade it, I deleted python
from /usr/bin/
and renamed python3.6
as python
in the same directory.
Afterwards, my terminal stopped working.
It gets no response on opening it.
Earlier, my default Python version was python2.7
.
To upgrade it, I deleted python
from /usr/bin/
and renamed python3.6
as python
in the same directory.
Afterwards, my terminal stopped working.
It gets no response on opening it.
The main lesson here is not to mess with system files unless you know exactly what you're doing. The directory /usr/bin is managed by the package manager, APT (as in apt-get
and apt
), so you will never need to manually make changes to it. You're not alone though. Lots of folks make changes to the system Python setup without realizing that most of the GUI depends on it.
Now, how can you fix this?
Put python3.6
back, cause the system depends on it (via /usr/bin/python3
, which is a symlink to python3.6
)
sudo mv /usr/bin/python /usr/bin/python3.6
Either reinstall python2.7
sudo apt-get install --reinstall python2.7-minimal
or remove it (warning OP is using Ubuntu 18.10, which does not rely on python-2.7
by default. If you're using a different version, don't do this)
sudo apt-get remove python2.7
python3
every time.
python3.6
aspython
. Doing so will break your system quite horribly. Depending upon the version of Ubuntu you are using, it might be recoverable, it might not. – user535733 Dec 02 '18 at 20:33