When I checked Python version as normal user, it is showing Python 2:
$ python --version
Python 2.7.15rc1
And when try to run as root :
# python --version
Python 3.6.7
Any suggestion how to remove this Python 2.7
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.
Sign up to join this communityYou need to define the two different python versions
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.NN 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.NN 2
Then you need to choose which version should be defined as default
sudo update-alternatives --set python /usr/bin/python3.NN
Note! You need to check what version you have of python and replace NN with your version.
python2 --version
python3 --version
python
, you must define aliases in .bashrc instead of removing python. Messing up python may cause your system to break.