Finding Python site-packages

Quick way to locate the Python site-packages directory:

python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"

Most likely here on Mac OS X:

/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/site-packages

2 comments ↓

#1 Dorival Pedroso on 08.06.08 at 5:52 am

Great tip.
Thanks!

#2 finding where python packages are installed « random things on 07.12.09 at 11:32 pm

[...] This is an interesting code snipped that I found here: [...]

Leave a Comment