[Nix-dev] Python package works with PYTHONHOME but not with PYTHONPATH

Nikolay Amiantov ab at fmap.me
Wed Dec 21 14:20:02 CET 2016


On 12/21/2016 12:55 AM, Nikolay Amiantov wrote:
> tl;dr: Why can a Python package behave differently when imported using
> PYTHONPATH and PYTHONHOME? Specifically, work with *HOME but not with *PATH.

I've untangled this yesterday, it seems the problem was that the package
in question relied on a .pth file installed by another package in the
same directory, so it didn't provide its own .pth file. When everything
was symlinked to one directory (buildEnv scenario) this assumption held,
so the package worked.

To my future self: Python not only searches packages in site-packages
directory, but also searches there for .pth files, which list additional
paths to be searched.

-- 
Nikolay.


More information about the nix-dev mailing list