Resolve version conflicts in python installation module packages

  • 2020-05-30 20:30:36
  • OfStack

The problem

Recently, I encountered a problem in my work. When installing the python software package, I often encounter such a problem. For example, for ipython, the installed version of the machine itself is 1.2.1, which is obviously too low to run jupyter. I tried to install it with pip, but found that the downloading process was smooth. However, such an error was always reported during the installation.

The error is as follows:

......'Not uninstalling ipython at /usr/lib/python2.7/dist-packages, owned by OS'......

It finally showed that ipython had been installed successfully, but when I looked at version, it was still 1.2.1, which made me 10 points apart.


A later study found that the reason for the problem was quite simple: ubuntu's version of apt-get was in conflict with the version installed by pip. Since the 'status' of apt-get is one point higher than that of pip (after all, the parent), the system will use the packages in apt-get first. However, the software in apt-get is so old that it can't keep up with the update speed of the python package. Although the pip version is new, it can't delete the old version of apt-get... This causes the uninstall problem mentioned in the error.

The solution

As for that, the solution to the problem is clear: just manually uninstall the outdated software packages in apt-get.


Related articles: