[Python-Dev] New relative import issue
Phillip J. Eby
pje at telecommunity.com
Thu Sep 21 23:23:13 CEST 2006
At 01:54 PM 9/21/2006 -0700, Guido van Rossum wrote:
>On 9/21/06, Paul Moore <p.f.moore at gmail.com> wrote:
> > On 9/21/06, Guido van Rossum <guido at python.org> wrote:
> > > I think one missing feature is a mechanism whereby you can say "THIS
> > > package (gives top-level package name) lives HERE (gives filesystem
> > > location of package)" without adding the parent of HERE to sys.path
> > > for all module searches. I think Phillip Eby's egg system might
> > > benefit from this.
> > This is pretty easy to do with a custom importer on sys.meta_path.
> > Getting the details right is a touch fiddly, but it's conceptually
> > straightforward.
>Isn't the main problem how to specify a bunch of these in the
Yes, that's exactly the problem, assuming that by environment you mean the
operating environment, as opposed to e.g. os.environ. (Environment
variables are problematic for installation purposes, as on Unix-y systems
there is no one obvious place to set them, and on Windows, the one obvious
place is one that the user may have no permissions for!)
More information about the Python-Dev