@Pinguincommander
To avoid further problems like this, do not use pip on the system python installation. In fact, by default, Ubuntu-MATE will never install it for you. If you notice on your new installation, it isn’t there.
If you wish to program in python here’s what you should do:
-
Install and use pyenv. A very nice tutorial of its capabilities is here: https://amaral.northwestern.edu/resources/guides/pyenv-tutorial, Pyenv will allow you to install python distributions in your home folder and use those instead of the system python for all your needs (programming or otherwise).
-
Don’t try to manually update any packages in your system python versions (in Ubuntu-MATE 16.04, you have two installations, currently 2.7.12 and 3.5.2). Even more important, do not try to update manually the system python versions. Let Ubuntu-MATE update manager update the python versions or any of the installed packages for you when it sees fit. These two installations and core to the Ubuntu-MATE system and should be left alone. Pyenv will help you even forget they are there.
Exceptions:
Sometimes you may wish to install a python package that requires sudo to be executed. This will not work if the package is installed in the HOME python installations set up by pyenv. A good example is ps_mem, which is one of the most accurate memory usage reporting utilities out there (see, for instance: https://ubuntu-mate.org/blog/mate-desktop-gtk2-vs-gtk3-memory-consumption/.
In these type of cases, you can of course install pip so that you can install the package at a system level.
sudo apt-get install python-pip # or sudo apt-get install python3-pip
sudo pip install ps_mem
But before you do that, always check Synaptic to make sure that package isn’t already available for you in the official repositories. If it is, use that instead and don’t use pip.
If you did have to install pip, do not then feel tempted to use this system pip to update any of of the existing packages in your system or elsewhere. You just used it to add another package to your system python installation and that’s it.
The above is also true if you wish to install certain packages that you want to become available to multiple users in your computer. But always keep a mental note of what you installed manually on the system. Those are the only packages you can updated manually.
Final warning:
If you do need to install pip as described above, it is because you need to install some package and make it available to all users on your system or be able to run it with sudo. But always check that package dependencies before installing. Go to https://pypi.python.org/pypi and check those dependencies there. If by any chance it depends on any existing system packages, no not install it or ask here before installing. There’s a chance it will try to override the older dependency version currently installed in the system and that may break your Ubuntu-MATE. If you can’t figure out by yourself if that will be the case, ask here before installing.
Modern distros dependency on Python is unfortunate for python developers. But there are plenty of ways to circumvent it and create good user or development python environments that leave the system python alone.