[Distutils] Installing header files with setuptools

Carl Meyer carl at dirtcircle.com
Wed Mar 3 23:30:03 CET 2010

Hash: SHA1

James Porter wrote:
> This works, but it installs the headers in a surprising place. With the
> "prefix" scheme, the headers end up in `pwd`/lib/include. With the
> "home" scheme, the headers end up in <home>/lib/python/lib/include.
> In either case I'd expect them to end up in <home-or-prefix>/include (or
> something like that anyway). I'd *certainly* expect the prefix scheme
> not to install the headers outside of the prefix.
> The issue, it seems, is a workaround for virtualenv in pip/req.py:
> <http://hg.notalon.org/ianb/pip/src/tip/pip/req.py#cl-515>. Since I'm
> not actually using virtualenv, I don't know exactly what would happen
> with that, but if there's a workaround for virtualenv, shouldn't it only
> be activated when virtualenv is in use? Not that I know how to detect
> that. :)

Yeah, that does appear to be a bug in pip, I've reported it at
And I think you have the right fix, too; that header location hack
should only happen if actually inside a virtualenv. Shouldn't be a hard
fix. Is your package publicly available? I don't have anything on hand
that installs header files to test the fix with.

BTW, the best way I know of to check for "am I in a virtualenv?" is to
check for the existence of sys.real_prefix.

Version: GnuPG v1.4.9 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org/


More information about the Distutils-SIG mailing list