where to put .pth file

Jim jim at trainplayer.com
Fri Oct 13 17:37:36 CEST 2006

I am trying to tell Python where it can find some modules it will need
when embedded in my app.  The convenient way would be to plop a .pth
file somewhere Python can find it.  I found that the doc is wrong when
it says this kind of filecan go anywhere on the python path.  It is not
found if it goes into the python root dir, or python\lib -- the only
place I found it would work was in lib\site-packages.

So the next question is, how do I know where this dir is located?  In
order to look in the Registry to find where Python is installed, I need
to know the version!  There is a set of keys under Python24 and another
set under Python25 on my machine.  That means I need to know what
version is installed before I can find out where its install dir is.

So how do I find out what version is installed?  The best way I came up
with so far is to ask Python for the value of sys.prefix.  Trouble is,
when I issue a PyRun statement, it fires up 24, not 25, and gives me
the 24 prefix.

In short: how do I find the latest installed site-packages directory?

  -- Jim

More information about the Python-list mailing list