[Python-Dev] New relative import issue

Oleg Broytmann phd at phd.pp.ru
Tue Sep 19 11:47:38 CEST 2006

On Tue, Sep 19, 2006 at 03:46:59PM +1200, Greg Ewing wrote:
> There really shouldn't be
> any such thing as sys.path -- the view that any
> given module has of the package namespace should
> depend only on where it is

   I do not understand this. Can you show an example? Imagine I have two
servers, Linux and FreeBSD, and on Linux python is in /usr/bin, home is
/home/phd, on BSD these are /usr/local/bin and /usr/home/phd. I have some
modules in site-packages and some modules in $HOME/lib/python. How can I
move programs from one server to the other without rewriting them (how can
I not to put full paths to modules)? I use PYTHONPATH manipulation - its
enough to write a shell script that starts daemons once and use it for many
years. How can I do this without sys.path?!

     Oleg Broytmann            http://phd.pp.ru/            phd at phd.pp.ru
           Programmers don't die, they just GOSUB without RETURN.

More information about the Python-Dev mailing list