2

I'm trying to find the installation directory in Pithos so I can hack it, and am really bad a unix commands and am embarrassed to ask this. If I do:

`which pithos`

This returns a link to the script installed in /usr/bin, but doesn't show me where all of the pithos source files are. What is the best way to do something like this?

I'm on Ubuntu 14.04

2 Answers2

3

Typically, python package source files are located in /usr/lib/python<version>/site-packages. There's more information about this in the python docs:

jayhendren
  • 8,384
  • 2
  • 33
  • 58
  • You're right. I'm an idiot and didn't realize it would install as a normal python package; thought there was something more to it. – Adam Hughes Jan 30 '15 at 19:18
1

Where the packages gets installed heavily depends on the system configuration /usr/lib/python<version>/site-packages is a good candidate but doesn't always exists, sometimes this is /usr/lib/python<version>/dist-packages or /usr/local/lib/python<version>/site-packages etc.

The generic way if you have found the pithos script is to locate the files it is importing. You can use locate for that if you have that installed, or find / modulename.py, but quite often it is quicker to start up python and then do (adapting the module name to import to the ones imported in the script):

>>> import pithos
print pithos.__file__
Anthon
  • 79,293