does easy_install.py need to guess the site-packages path?

As an example I'm looking at setuptools-0.6c11-py2.7.egg, can someone tell me why setuptools/command/east_install.py in get_site_dirs() does its own computation of where site-packages is? As of 2.7 there are already 4 separate places in the python where this path is computed. Maybe I'm missing something but I don't see why an egg would have an opinion on this matter. Regards, - James

At 12:00 AM 6/7/2011 -0700, James wrote:
As an example I'm looking at setuptools-0.6c11-py2.7.egg, can someone tell me why setuptools/command/east_install.py in get_site_dirs() does its own computation of where site-packages is? As of 2.7 there are already 4 separate places in the python where this path is computed. Maybe I'm missing something but I don't see why an egg would have an opinion on this matter.
It doesn't do that in order to know where to install things; it does it to know what places are *safe* to install things that need .pth support. (And unfortunately, there is no way to obtain this list from the site module directly.)

On Tue, Jun 7, 2011 at 6:30 PM, P.J. Eby <pje@telecommunity.com> wrote:
At 12:00 AM 6/7/2011 -0700, James wrote:
As an example I'm looking at setuptools-0.6c11-py2.7.egg, can someone tell me why setuptools/command/east_install.py in get_site_dirs() does its own computation of where site-packages is? As of 2.7 there are already 4 separate places in the python where this path is computed. Maybe I'm missing something but I don't see why an egg would have an opinion on this matter.
It doesn't do that in order to know where to install things; it does it to know what places are *safe* to install things that need .pth support.
I'm seeing it make up the path and then fail in a copytree since the computed dest directory in my case doesn't exist So I'm not exactly sure what you mean when you say it doesn't.
(And unfortunately, there is no way to obtain this list from the site module directly.)
I guess that is the nub, oh well. cheers, - James

At 09:54 PM 6/7/2011 -0700, James wrote:
On Tue, Jun 7, 2011 at 6:30 PM, P.J. Eby <<mailto:pje@telecommunity.com>pje@telecommunity.com> wrote: At 12:00 AM 6/7/2011 -0700, James wrote: As an example I'm looking at setuptools-0.6c11-py2.7.egg, can someone tell me why setuptools/command/east_install.py in get_site_dirs() does its own computation of where site-packages is? As of 2.7 there are already 4 separate places in the python where this path is computed. Maybe I'm missing something but I don't see why an egg would have an opinion on this matter.
It doesn't do that in order to know where to install things; it does it to know what places are *safe* to install things that need .pth support.
I'm seeing it make up the path and then fail in a copytree since the computed dest directory in my case doesn't exist So I'm not exactly sure what you mean when you say it doesn't.
Unless you override it, easy_install asks the distutils where to install things. So, the "made up path" you're referring to came from the distutils. (Which has yet *another* set of code to generate the path(s)!) If you set "DISTUTILS_DEBUG=yes" in your environment variables, and run the easy_install again, you'll see exactly where every setting comes from. The output of get_site_dirs() is *not* used to determine the installation path, only to *validate* it.
(And unfortunately, there is no way to obtain this list from the site module directly.)
I guess that is the nub, oh well.
cheers, - James
participants (2)
-
James
-
P.J. Eby