Posts: 6
Joined: Tue May 27, 2014 3:31 pm

Location of python libraries on RPi

Fri Jun 06, 2014 12:36 pm

I need to modify a certain library, so I need to find it's location. Could someone tell me, where are libraries stored on RPi, especially newly installed ones.

I installed RPIO and need to modify the library.

Thank you!

User avatar
Posts: 2616
Joined: Sat Jan 28, 2012 11:57 am
Location: UK

Re: Location of python libraries on RPi

Fri Jun 06, 2014 12:54 pm

Hi, I'm not near the Pi at the moment and not even on a linux machine but I think they go somewhere like
you can get the full list of possible location by:
$ python
>>> import sys
>>> sys.path
which will print a list of strings corresponding to places on the python system path (which is where 'import' will look

However you really SHOULD NOT hack those installed library files. If you need to do something like that then take a copy and put it in a location in the path that comes before the installed location (like the same directory as the script you are importing it from) Or to a parallel directory and change the module name (quite a bit of editing may be involved)

Return to “Python”