easy_install, pip, py3, and official IPython documentation

Tag: ipython Author: eeeeeee01 Date: 2012-12-26

Today I noticed this fairly old (and highly voted) question and it made me wonder, if pip is generally preferred over easy_install in the Python community, why is the official ipython.org documentation instructing newcomers like me to use easy_install as shown here?

Perhaps there is an implicit assumption that readers are using Python 2? Although the highly voted question and several answers all seem to indicate that pip is widely preferred over easy_install for both py2 and py3, so that seems like it's not the answer...

Best Answer

The command:

easy_install ipython[zmq,qtconsole,notebook,test]

will install IPython and some dependencies, including pyzmq, which has compiled parts.

easy_install handles binary packages, so it can install precompiled versions of things like pyzmq. pip, by contrast, only works with source packages. So for a package with compiled parts, it downloads the source code and tries to compile it. There are two problems with that:

  1. The user needs to have a C compiler installed, plus whatever development headers the code being compiled relies on. The user often doesn't.
  2. It's slow, especially for larger packages.

So the scientific Python world, which uses a lot of compiled packages, doesn't use pip as much as web developers. Actually, we don't much like easy_install either - we have a variety of more powerful installation methods.

comments:

Many thanks. Makes sense now why intro docs advise new users to install with a tool that handles binary packages. OTOH, I'm quite happy to build from sources. Been using MacPorts for non-Python stuff for years. That said, what would you say is the best package management method for doing Scipy with py3 on OS X? From your link, looks like only Pyzo does py3, which won't work with OS X. Though your link mentions only py2 for MacPorts, Anaconda, and EPD, I do see numpy, scipy, matplotlib, ipython, pandas, sympy, and nose all in py3 MacPorts packages. How do you manage your packages?
@KevinF : Personally, I'm on Ubuntu, so I have apt (I've heard it said that "apt solves problems other packaging systems don't even know about"). If you see all the necessary things in Macports packages, go for that. Note that Macports can do compilation from source sensibly, because it knows about non-Python build dependencies. It's still slow, though - I had to install Qt on a Mac once, and compiling that took several hours.