[Nix-dev] Re: Python 3

Marc Weber marco-oweber at gmx.de
Fri Feb 20 14:18:45 CET 2009


On Fri, Feb 20, 2009 at 01:42:22PM +0100, Peter Simons wrote:
> Hi Marc,
> 
>  >>  (b) Patch libA to extend "sys.path" as required before trying to import
>  >>      libB. It's not pretty -- particularly if libA consists of a large
>  >>      number of individual files --, but it does solve the problem and
>  >>      requires no user action whatsoever.
>  >
>  > Than we do have implicit imports.
quote: >> Patch libA to extend "sys.path" <<
Thus you can no longer tell libA to extend sys.path ?
So libA does an implicit import for you.


http://www.python.org/doc/2.6/library/site.html
Just browse some of the libraries, example:
single line content of 
/nix/store/gs9f7x7b65806gigk8xz0ysw4wg6d57h-pygobject-2.15.4-and-pygtk-2.12.1/lib/python2.5/site-packages/pygtk.pth:

  gtk-2.0

Thus without reading this .pth file (or maybe more than that one) you
won't have gtk-2.0 support. If you just set PYTHONPATH gtk-2.0/* dirs
(see link above) won't be added to sys.path for you.

Marc



More information about the nix-dev mailing list