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).
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
or ldd $(which python)
Mac: otool -L <path>/python
Windows: run dependencywalker on python.exe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With