Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why do pythonics prefer pip over their OS's package managers? [closed]

When reading tutorials and readmes I often see people advertising to install python packages with pip, even when they are using an operating system, which has a nice package manager like apt. Yet in real life I only met people who would only install things with their OS's package manager, reasoning that this package manager will treat all packages the same, no matter if python or not.

like image 466
erikbstack Avatar asked Oct 30 '12 11:10

erikbstack


1 Answers

There are two main reasons that Pythonistas generally recommend pip. The first is that it is the one package manager that is pretty much guaranteed to come with a Python installation, and therefore, independent of the OS on which you are using it. This makes it easier to provide instructions that work on Windows and OS X, as well as your favourite Linux.

Perhaps more importantly, pip works very nicely with virtualenv, which allows you to easily have multiple conflicting package configurations and test them without breaking the global Python installation. If I remember correctly, this is because pip is itself a Python program and it automatically runs within the current virtualenv sandbox. OS-level package managers obviously do not do this, since it isn't their job.

Also, as @Henry points out below, it's easier to just list your package in a single place (PyPI) rather than depending on the Debian/Ubuntu/Fedora maintainers to include it in their package list. Less popular packages will almost never make it into a distribution's package list.

That said, I often find that installing global libraries (numpy, for example) is easier and less painful with apt-get or your favourite alternative.

like image 117
Chinmay Kanchi Avatar answered Oct 06 '22 01:10

Chinmay Kanchi