Pip vs Package Manager for handling Python Packages

malan88

Python packages are frequently hosted in many distribution's repositories. After reading this tutorial, specifically the section titled "Do you really want to do this" I have avoided using pip and preferred to use the system repository, only resorting to pip when I need to install a package not in the repository.

However, because this is an inconsistent installation method, would it be better to only use pip? What are the benefits/detractors to using pip over the system's own repository for packages that are available in both places?

The link I included states

The advantage of always using standard Debian / NeuroDebian packages, is that the packages are carefully tested to be compatible with each other. The Debian packages record dependencies with other libraries so you will always get the libraries you need as part of the install.

I use arch. Is this the case with other package-management systems besides apt?

Stephen Kitt

The biggest disadvantage I see with using pip to install Python modules on your system, either as system modules or as user modules, is that your distribution’s package management system won’t know about them. This means that they won’t be used for any other package which needs them, and which you may want to install in the future (or which might start using one of those modules following an upgrade); you’ll then end up with both pip- and distribution-managed versions of the modules, which can cause issues (I ran into yet another instance of this recently). So your question ends up being an all-or-nothing proposition: if you only use pip for Python modules, you can no longer use your distribution’s package manager for anything which wants to use a Python module...

The general advice given in the page you linked to is very good: try to use your distribution’s packages as far as possible, only use pip for modules which aren’t packaged, and when you do, do so in your user setup and not system-wide. Use virtual environments as far as possible, in particular for module development. Especially on Arch, you shouldn’t run into issues caused by older modules; even on distributions where that can be a problem, virtual environments deal with it quite readily.

It’s always worth considering that a distribution’s library and module packages are packaged primarily for the use of other packages in the distribution; having them around is a nice side-effect for development using those libraries and modules, but that’s not the primary use-case.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

Pip vs Package Manager for handling Python Packages

From Dev

VS2015 nuget package manager not finding packages

From Dev

Package Manager vs Dependency Manager

From Dev

ubuntu packages and Advance Package Manager

From Dev

Extend pip package with other packages

From Dev

PIP and python installing packages

From Dev

python packages not updating with pip

From Dev

Nuget Package Manager showing updates for packages not installed

From Dev

Acces selected packages using Package Manager

From Dev

Packages from OS or from custom package manager

From Dev

Cygwin Package Manager - Installed Packages Not Appearing

From Dev

'obsoleting packages' in package manager output? [DNF]

From Java

Package Manager: Bower vs jspm

From Dev

Is there an alternative for vs Nuget Package Manager?

From Dev

Fixing all pip and package manager incompatibilities

From Dev

python and package manager are broken

From Java

Python: cannot install packages with pip

From Dev

Installing python packages using pip

From Dev

Python:Install packages with pip; issue

From Java

Specific reasons to favor pip vs. conda when installing Python packages

From Dev

Specific reasons to favor pip vs. conda when installing Python packages

From Dev

NuGet Package Manager: "No packages found" even though the package exists

From Dev

NuGet Package Manager: "No packages found" even though the package exists

From Dev

Bower package manager illegible in VS2015

From Dev

Nuget Package Manager Unresponsive in VS 2015

From Java

Package Manager vs. Git Submodule/Subtree

From Dev

Add migration from Package Manager vs dnx

From Dev

Bower package manager illegible in VS2015

From Dev

Installing Python without package manager

Related Related

HotTag

Archive