Python and location of .so files?

Carsten Haese carsten at
Tue Jan 10 16:43:28 CET 2006

On Tue, 2006-01-10 at 09:42, Efrat Regev wrote:
>    Hello,
>    On FC4, I've generated an .so file from C++ which I want to use from 
> python. It works when I copy it into /usr/lib/python2.4/site-packages.
> (I.e., say I have in that directory, then from the python 
> prompt I can 'import hello', and the code works fine). The problem is 
> that the said directory requires su - so I'd rather python load my .so 
> from a different user-privilege directory (when I type 'import hello'). 
> Is there some way to tell python to use a different directory?

Yes. See for
information on Python's module search path.

Hope this helps,


More information about the Python-list mailing list