[Nix-dev] Re: python search path and PyQt4&dbus

Yury G. Kudryashov urkud+nix at ya.ru
Thu Aug 26 09:29:24 CEST 2010


Marc Weber wrote:

> Excerpts from Yury G. Kudryashov's message of Wed Aug 25 20:39:40 +0200
> 2010:
> There is no trivial fix. All python package were designed to be run from
> one directory only. This means everything "magically" works when
> assembling packages in ~/.nix-profile - but it fails when configuring
> etc, because there are many store paths.
if PYTHONPATH=~/.nix-profile/lib/python2.x/site-packages :)

> The issue is that some other packages such as gnome which depend on
> pygtk also install into their pygtk 2.0 dir which pygtk doesn't know
> about.
Yes, the same here.
> The current (hacky) way in nixpkgs is:
> 
> - ignore the pygtk.require not adding all paths to sys.path.
> 
> - instead manually add those PYTHONPATH which is tedious because
>   you always have to add those PATH's by try and error until something
>   works.
The problems *is* that it ignores PYTHONPATH while searching for submodules. 
I will use another "hacky" way: symlink pythonDBus into pyqt4. I know that 
it is hacky.
> 
> This worked somewhat reasonable because nobody was using the packages
> depending on pygtk (such as pygnome) extensively - so nobody had to
> manually add that much PATHs.
Adding *all* dependencies and wrapping python programs is OK for me.

About patches, I'd prefer to patch python to use PYTHONPATH while searching 
for submodules, then wrap each executable by PYTHONPATH=...




More information about the nix-dev mailing list