[Distutils] What is the reason for requiring that an explicitly set egg-install installation is in the path?

Phillip J. Eby pje at telecommunity.com
Thu May 18 16:27:22 CEST 2006


At 10:08 AM 5/18/2006 -0400, Jim Fulton wrote:

>If I explicitly specify an installation directory, for example, by
>specifying:
>
>    [install]
>    install_lib = ~/py-lib
>    install_scripts = ~/bin
>
>in setup.cfg, setuptools gives me an error is the specified
>lib dir isn't in the Python path.
>
>Why is this?  Is this for my protection? If so, I don't need a path
>nanny. :)

Maybe not, but everybody else does.  ;)


>   I can understand this, to some degree, if --prefix is used,
>but if I specifically set an install location, setuptools should trust
>that I know what the heck I'm doing.

EasyInstall is telling you that as things stand, it can't accomplish what 
you asked it to -- specifically to install to that directory in such a way 
that the package is importable.  If you use -m (aka --multi-version), then 
it will not care because getting stuff on the runtime path is then *your* 
responsibility, not setuptools'.

The issue here is that when you install eggs without -m, the target 
directory must support .pth files.  To do that, it must be on PYTHONPATH 
(and use a site.py hack) or it must be a "site" directory.  You can assert 
that a directory is a "site" directory using --site-dirs, and EasyInstall 
will then believe you.

In short, use -m or --site-dirs, and in either case EasyInstall will permit 
you to be responsible for the results, without nannying.  But if you don't 
use either of those options, then it will want proof of your sanity (i.e. a 
correct PYTHONPATH) when installing to a non-site directory.  :)



More information about the Distutils-SIG mailing list