[Distutils] Not installing the install_requires
peterbe at gmail.com
Wed Jul 15 16:25:28 CEST 2009
On Jul 15, 2:16 pm, Jean-Paul Calderone <exar... at divmod.com> wrote:
> On Wed, 15 Jul 2009 04:29:05 -0700 (PDT), Peter Bengtsson <pete... at gmail.com> wrote:
> >I've just made a package
> >To figure out if I've got it right I've tried installing it like
> > [snip - install failure log]
> >The setup.py
> >contains the following:
> > install_requires=[
> > 'lxml',
> > ],
> >Why does easy_install not try to install lxml before it installs the
> Because it has to evaluate your setup.py to learn that it requires lxml,
> but your setup.py *also* requires lxml, apparently because you're trying
> to avoid spelling our your package's version number more than once. This
> has been discussed recently on this list a couple times:
Ok. Thanks for spotting that. I'll change the package so that I
manually type in the version number.
Or even better actually. I'll add a file into the package called
version.txt and read that on the fly.
I've got a more pressing problem now, when I try to easy_install my
package it tries to install lxml even though it's already installed!
(djangopeoplenet)peterbe at trillian:~/djangopeoplenet $ cat `which
easy_install` | head -n 1
(djangopeoplenet)peterbe at trillian:~/djangopeoplenet $ /home/peterbe/
Python 2.5.2 (r252:60911, Oct 5 2008, 19:24:49)
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import lxml
(djangopeoplenet)peterbe at trillian:~/djangopeoplenet $ easy_install
Searching for premailer
Best match: premailer 1.2
premailer 1.2 is already the active version in easy-install.pth
Processing dependencies for premailer
Searching for lxml
Best match: lxml 2.2.2
Running lxml-2.2.2/setup.py -q bdist_egg --dist-dir /tmp/
Building lxml version 2.2.2.
NOTE: Trying to build without Cython, pre-generated 'src/lxml/
lxml.etree.c' needs to be available.
Using build configuration of libxslt 1.1.24
Building against libxml2/libxslt in the following directory: /usr/lib
src/lxml/lxml.etree.c:4:20: error: Python.h: No such file or directory
src/lxml/lxml.etree.c:5:26: error: structmember.h: No such file or
src/lxml/lxml.etree.c:7:6: error: #error Python headers needed to
compile C extensions, please install development version of Python.
error: Setup script exited with error: command 'gcc' failed with exit
Why is this a problem? Getting lxml to build in a virtual environment
is far from trivial and that's why I (amongst others) prefer to use OS
packages (debian apt in my case).
More information about the Distutils-SIG