Idea: PYTHONPATH_VER

Fernando Perez fperez528 at yahoo.com
Sat May 15 00:37:17 EDT 2004


Peter Hansen wrote:

> Having missed the discussion preceding, I'm probably off the mark,
> but in my experience just about everything that can be solved with
> PYTHONPATH can be handled with a .pth file as well, and I haven't
> had any need to use PYTHONPATH for quite some time as a result.

How do you handle the fact that .pth files are only read from certain places,
and not others?  This problem has me currently rather stuck with gross hacks: 
packages like Numeric, which rely on a .pth file instead of being a 'true'
python package (with __init__.py), are very problematic.  I am trying to share
Numeric from an NFS mounted directory for multiple clients, located
at /usr/local/lib/python.  It was installed there via 'setup.py install
--home=/usr/local'.  The problem is that python does NOT scan this directory
for .pth files, even if it is listed in PYTHONPATH.  .pth files only have an
effect for directories in sys.prefix, I think.

I have actually come to HATE with a vengeance packages which rely on .pth files,
because of this behavior of python of not including them for anything in
PYTHONPATH.  So I would really appreciate pointers from someone who has
successfully solved this, since it's quite likely that I'm just misusing the
system.

Thanks in advance,

Fernando



More information about the Python-list mailing list