-1

I'm wondering what the difference is between pip, the Python package installer, and yum?

As a means of providing some context to my question:

I assume the first answer will be because PIP is only for installing Python packages and yum installs packages from different types of vendors. But lets focus on the installation of Python packages using both tools as a means of identifying the difference between both:

I had an issue in work (using CentOS6) where Django was a missing dependency for an rpm I was trying to install. I thought the correct fix was to 'pip install Django'. However, when I did this and re-tried the 'rpm -i' the Django dependency was still reported as missing.

A far more experienced colleague told me what I was doing was wrong and I needed to un-install this and only ever install using yum. From experience I know he is not one to elaborate on things and after a bit of googling I am still in the dark.

I can't get my head around why there is a difference, if both install the same package how come one works as a means of satisfying the required dependency and the other (pip) does not.

  • What does pip -V return and is it the pip you've installed with yum? Most probably you have multiple Python installations, causing the ambiguity. – hoefling Jul 31 '18 at 13:45
6

Extending on the excellent @dr01 answer about yum vs pip:

With yum normally all the official packages installed by the distribution are updated in one single operation. Also, the system will do a better job of getting dependencies that do not enter on conflit with packages already installed, and with packages that have been tested by the distribution maintainers.

Using pip, especially if are not so experienced in what you are doing, it is easier to shoot yourself on the foot, and end up configuring (or not configuring things) as desired and/or getting dependencies wrong. In addition, depending on your configuration, there might be different pip commands that map to different versions of python you might have installed.

When doing security updates, you will also have to remember to update things installed with pip, and that brings unwanted complexity to system administration procedures.

Summing it up, unless you need a special version of a python library, and/or you cannot find it in the distribution repositories, using yum instead of pip is good advice.

2

Yum is the package manager for the OS (CentOS/RedHat). This is what you use to install, update, or remove software on your computer.

Pip is a package manager exclusively for software written in Python. You need to use it only if you're closely working with Python, for instance using a Python tool or developing Python programs.

  • I have rephrased the question so I request you remove the downvote. You said: toolA installing packageX != toolB installing packageX and you should only use toolB when working exclusively with programY. To be clear, I understand this but I wanted to know why? Why if I install using toolA or toolB is there a difference on the system level? Is there some sort of associations which depend on which type of tool used? etc... – MarkMark Jul 31 '18 at 11:07
  • I did not downvote your question. To answer your question, the packages you can install via Yum aren't the same you can install via Pip. – dr01 Jul 31 '18 at 12:36
  • Ok, no problem, thank you, apologies for the confusion. Ok, so packages are not the equal. My incorrect assumption was that some kind of Django package exists for each specific OS (CentOS6 in this case) and was confused as to why different tools are used install the "same" package with different results. I now know that many different packages can exist for some application (for a given OS) and there are several tools available to install these packages. It is the developers responsibility to identify the required package for his OS and subsequently the correct installation tool. – MarkMark Jul 31 '18 at 12:44

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.