tags:

views:

90

answers:

1

Given a Python compiled as a shared library, how do I determine the name and path of this library?

The output I'm looking for is like "/usr/local/lib/libpython2.7.so" or "/System/Library/Frameworks/Python.framework/Versions/2.6/Python" (for a framework build on OS X).

+1  A: 

I'm not sure how or if it can be done within Python itself, but you can use standard tools for finding shared library dependencies for the python executable.

Linux: ldd <path>/python
Mac: otool -L <path>/python
Windows: run dependencywalker on python.exe

ma3