Why would a python framework installation guide advise the use of easy_install for some required packages and pip for others?
Asked Answered
P

2

7

After a failed attempt at a "streamlined" install of the SimpleCV framework superpack for Windows. I'm now working through a manual installation guide (which I'm OK with as I have more control over the installation and might finally learn about installing Python Packages properly in Windows!)

Rather than just blindly follow the guide I'm trying to understand each step, so I'm confused by this..

 easy_install pyreadline
 easy_install PIL
 easy_install cython
 easy_install pip
 pip install ipython
 pip install https://github.com/ingenuitas/SimpleCV/zipball/1.3

Why not easy_install pip as soon as possible then pip the other packages?..

 easy_install pip     {{{I intend to research and probably use get-pip.py here}}}
 pip install pyreadline        
 pip install PIL
 pip install cython
 pip install ipython
 pip install https://github.com/ingenuitas/SimpleCV/zipball/1.3

Is there a pitfall doing it this way? (My limited understanding is that it's always preferable to use pip rather than easy_install.)

I know this question relates directly to SimpleCV but I want to learn the correct approach for when I'm installing package collections in the future without the benefit of a guide.

Pyrophoric answered 7/4, 2013 at 19:18 Comment(0)
O
5

pip fetches the source code of the packages you're trying to install and compiles them. So if you don't have a compiler installed and configured it will fail to do so for packages which contain extensions written in C, which in this case applies to pyreadline, PIL and cython.

easy_install uses the precompiled packages from pypi (at least for windows if they're available), which means you don't need to compile everything yourself.

For pure python packages it's no problem using pip instead of easy_install, and if you have a compiler and the neccessary build dependencies installed it should also work.

Orangutan answered 7/4, 2013 at 19:36 Comment(5)
Thank you for such a lucid answer Mata! I'd got as far as thinking "We'll they both download the package, what's the difference? (Apart from the benefits pip brings) - I didn't consider what's actually being downloaded, so thanks again for clearing that up. It does raise the question of how to establish whether a package is pure python or not. Should I default to just trying pip and resort to easy_install if it fails attempting a compilation?Pyrophoric
That's what I usually do. pip also follows the download urls from pypi, so occasionally it installes a newer version from the homepage of the project then the packaged one from pypi. You could also look directly on pypi if C is listed as 'Programming Language' in the description.Orangutan
Yes had noticed the language references at PyPi, wasn't sure if that was just a meta-tag indicating the package maybe C related in some way rather than definitely having C source (e.g a "C" Tutorial package written in pure python).Pyrophoric
...OK to be fair I've double checked and it explicitly states "Programming Language." I understood pip would follow links and attempt to obtain the latest version - I imagine that can lead to further problems on occasion.Pyrophoric
The metadata is maintained by the package owner, so it's never guaranteed that it's correct. Usually seeing C there is a very strong hint that it contains extensions in this language, but you're right, the maintainer could also put it there for other reasons.Orangutan
B
2

I believe the answer is that pip does not currently support the installation of binary distributions, i.e. Python packages that include pre-compiled C extension modules. easy_install does.

BTW, there is work afoot to provide replacements for pip (and easy_install) that will fully support binary distributions on all platforms. See here for an overview.

Bronco answered 7/4, 2013 at 19:36 Comment(1)
OK thank you Ned, so another reason for having to resort to easy_install on occasion. I'll keep an eye on future developments as I'm also in a state of confusion over using distribute in place of setuptools.Pyrophoric

© 2022 - 2024 — McMap. All rights reserved.