Simple trick to figure out where your python libraries are stored

Posted in python , simple

Here’s a simple trick to figure out where your python libraries are stored. This location can vary from distribution to distribution.

$ python
Python 2.6.2 (r262:71600, Jun 4 2010, 18:28:58)
[GCC 4.4.3 20100127 (Red Hat 4.4.3-4)] on linux2
Type “help”, “copyright”, “credits” or “license” for more information.

>>> from distutils.sysconfig import get_python_lib
>>> print get_python_lib()

/usr/lib/python2.6/site-packages

strahob-monastery-library

Or simply do it all straight from a command shell.

python -c "from distutils.sysconfig import get_python_lib; print get_python_lib()"
Posted by admica   @   27 October 2010
Tags : , ,

Related Posts

1 Comments

Comments
Mar 14, 2012
5:21 pm
#1 Rob :

Great tip!!! Thanks! Now I just need to figure out why “import gtk” throws a not found message when I have “gtk-2.0″ in my distro.

Leave a Comment

Name

Email

Website

*

Previous Post
«
Next Post
»
Powered by Wordpress   |   Lunated designed by ZenVerse

Valid XHTML 1.0 Transitional