I am quite new with Ubuntu. I have Ubuntu 18.04.04
In the terminal, python --version
returns Python 2.7.17.
But, I have installed Spyder with the Ubuntu Software Center. When I run Spyder the version is 3.6
Why I have two versions? And,can I remove version 2.7? How?
You have two versions because 18.04 happened to be in the middle of Ubuntu's conversion from Py2 to Py3. So you have both versions on your system. Newer releases have only Python3.
DO NOT remove the default versions of Py2 and Py3 provided with Ubuntu 16.04 or 18.04. Doing so will break your system quite horribly.
On Ubuntu 19.10 and newer, Py2 is no longer included with the default install of Ubuntu, and is no longer in the -main pocket of the Ubuntu repository. It's still in the repositories (moved to -universe), and some -universe and -multiverse packages still depend upon Py2...but they are not part of a new install.