Python and location of .so files?

Efrat Regev efrat_regev at
Tue Jan 10 17:20:02 CET 2006

Carsten Haese wrote:
> 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,
> Carsten.

Perfect. Thank you very much!

More information about the Python-list mailing list