Determining python installation prefix

Dave Cole djc at itga.com.au
Mon Oct 4 21:57:43 EDT 1999


I have some Python modules that I want to install via Makefile on a
number of boxes.  On the Linux box, the installation prefix is /usr,
whereas on Solaris and FreeBSD, the prefix is /usr/local.

Is there a nice way to ask the Python interpreter where it was
installed?  I have come up with this ugly hack:

(unset PYTHONPATH; echo 'import sys; print sys.path[1]' | python -)

But I would not like to rely on that...

- Dave




More information about the Python-list mailing list