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

1
  • Contents-amd64.gz is a funny thing, I suggest to google for it.
    – peterh
    Jan 30, 2015 at 19:28

2 Answers 2

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:

1
  • 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. Jan 30, 2015 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__

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .