How do I find the location of my Python site-packages directory?

Daryl Spitzer picture Daryl Spitzer · Sep 23, 2008 · Viewed 1M times · Source

How do I find the location of my site-packages directory?

Answer

eudoxos picture eudoxos · Oct 18, 2012
>>> import site; site.getsitepackages()
['/usr/local/lib/python2.7/dist-packages', '/usr/lib/python2.7/dist-packages']

(or just first item with site.getsitepackages()[0])