packages in special directories?

Michal Wallace sabren at
Wed Feb 16 01:55:07 EST 2000

Hey all,

How can I make a .pth file point outside the main python directory?

I have my package development directory organized like this:


I like having my code under \zike\code for backup purposes,
and to keep it seperate from work I do for other companies, etc.

Anyway, I want to be able to "import weblib" ... I know I can put
it in PYTHONPATH, but that's already messy, so I wanted to
try out the .pth notation..

so I made:

c:\program files\python\weblib.pth

which contains one line:


... but this doesn't work.... neither does:


So I settled (for now) with changing it to:


and making a fake c:\program files\python\weblib\
which just appends the real directory to __path__...

But why doesn't the other way work? I'd think this would come
in handy, for example, if you have one version in production and
are working on another... ??


More information about the Python-list mailing list