views:

1371

answers:

4

A tweet reads:

Don't use easy_install, unless you like stabbing yourself in the face. Use pip.

Why use pip over easy_install? Doesn't the fault lie with PyPI and package authors mostly? If an author uploads crap source tarball (eg: missing files, no setup.py) to PyPI, then both pip and easy_install will fail. Other than cosmetic differences, why do Python people (like in the above tweet) seem to strongly favor pip over easy_install?

(Let's assume that we're talking about easy_install from the Distribute package, that is maintained by the community)

+15  A: 

Two reasons, there may be more:

  1. pip provides an uninstall command

  2. if an installation fails in the middle, pip will leave you in a clean state.

Ned Batchelder
+24  A: 

From Ian Bicking's own introduction to pip:

  • All packages are downloaded before installation. Partially-completed installation doesn’t occur as a result.
  • Care is taken to present useful output on the console.
  • The reasons for actions are kept track of. For instance, if a package is being installed, pip keeps track of why that package was required.
  • Error messages should be useful.
  • The code is relatively concise and cohesive, making it easier to use programmatically.
  • Packages don’t have to be installed as egg archives, they can be installed flat (while keeping the egg metadata).
  • Native support for other version control systems (Git, Mercurial and Bazaar)
  • Uninstallation of packages.
  • Simple to define fixed sets of requirements and reliably reproduce a set of packages.
Daniel Roseman
The "error messages" advantage is huge, especially for newer users. Easy-install is famous for spitting out dozens of what look like fatal errors, only to have wound up doing the install successfully anyway, which makes it difficult to use until you learn to ignore most everything it says. Pip simply omits saying those things in the first place.
Brandon Craig Rhodes
+5  A: 

REQUIREMENTS files.

Seriously, I use this in conjunction with virtualenv every day.

Matthew Schinckel
+1  A: 

pip won't install binary packages and isn't well tested on Windows.

As Windows doesn't come with a compiler by default pip often can't be used there. easy_install can install binary packages for Windows.

fuzzyman
Interesting, I never thought of that. pip also doesn't support the setuptools "extras" features that is used by the Zope folks at least.
Sridhar Ratnakumar