Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

When do you need path config files (.pth)?

1 view
Skip to first unread message

Terry Hancock

unread,
Jan 8, 2003, 7:09:03 AM1/8/03
to
A user of Python Universe Builder complained that the package installation
doesn't create a path configuration file (pub.pth), and that this kept him
from importing the package.

However, I don't have this file, and it imports just fine:

>>>import pub

Why might that be?

He's using Python 2.2.2 and I'm using 2.2.1 and we're both using Linux.

It's not so much that I object to making any changes, just that I don't
understand why it should work on one system and not on the other. I figure
there must be something else missing, or perhaps environment settings.

Thanks,
Terry


--
Anansi Spaceworks
http://www.anansispaceworks.com

"Martin v. Löwis"

unread,
Jan 8, 2003, 8:41:42 AM1/8/03
to
> It's not so much that I object to making any changes, just that I don't
> understand why it should work on one system and not on the other. I figure
> there must be something else missing, or perhaps environment settings.

It depends on where the pub directory has been installed. If it was
installed as an immediate subdirectory of site-packages or site-python,
no further configuration is needed. If it was installed elsewhere, a
.pth file should be created in site-packages that lists a single line
mentioning elsewhere.

Of course, the user could overcome the missing .pth file by setting
PYTHONPATH, but the rationale for creating .pth files is that not every
user of a system needs to set PYTHONPATH.

HTH,
Martin

0 new messages