pythonubuntu

Ubuntu, how do you remove all Python 3 but not 2


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?


Solution

  • So I worked out at the end that you cannot uninstall 3.4 as it is default on Ubuntu.

    All I did was simply remove Jupyter and then alias python=python2.7 and install all packages on Python 2.7 again.

    Arguably, I can install virtualenv but me and my colleagues are only using 2.7. I am just going to be lazy in this case :)