I have recently get hold of a RackSpace Ubuntu server and it has pythons all over the place: 

iPython in 3.5, Pandas in 3.4 &2.7, modules I need like pyodbc etc. are only in 2,7

Therefore, I am keen to clean up the box and, as a 2.7 users, keep everything in 2.7. 

So the key question is, is there a way to remove both 3.4 and 3.5 efficiently at the same time while keeping Python 2.7?
['https://Stackoverflow.com/questions/34198892', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/4779515/']
First of all, don't try the following command as suggested by Germain above. 

```
   `sudo apt-get remove 'python3.*'`

```

In Ubuntu, many software depends upon Python3 so if you will execute this command it will remove all of them as it happened with me. I found following answer useful to recover it.

<https://askubuntu.com/questions/810854/i-deleted-package-python3-on-ubuntu-and-i-have-lost-dashboard-terminal-and-un>

**If you want to use different python versions for different projects then create virtual environments it will be very useful. refer to the following link to create virtual environments.**

*Creating Virtual Environment also helps in using Tensorflow and Keras in Jupyter Notebook.*

<https://linoxide.com/linux-how-to/setup-python-virtual-environment-ubuntu/>
Its simple
just try:
sudo apt-get remove python3.7 or the versions that you want to remove