By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,767 Members | 1,987 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,767 IT Pros & Developers. It's quick & easy.

where to put .pth file

P: n/a
Jim
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.
Bizarre.

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

Oct 13 '06 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.