I'm trying to build Python 2.6 as a shared library, so I did:
No obvious signs of failure, but when I try and use the resulting
python, I get:
python2.6: error while loading shared libraries: libpython2.6.so.1.0:
cannot open shared object file: No such file or directory
Why might that be?
Simplistix - Content Management, Batch Processing & Python Consulting
The dynamic loader cannot find the python shared library. There are
at least 2 options:
1. Add path that contains the shared library to the
LD_LIBRARY_PATH environment variable. In a bash shell this can be
accomplished by: export LD_LIBRARY_PATH=/path/to/python_shared_lib:
2. Add path to dynamic linker configuration file. This typically
is in '/etc/ld.so.conf'. See man page for ld for more information.
Note that I assumed that you are on a Unix/Linux machine.
3. Set LD_RUN_PATH before you link the shared library or use the -rlink
option of the linker, see man(1) ld.
Yes, this was it.
Don't forget to run ldconfig after you've changed /etc/ld.so.conf
It's frustrating how the contents of this file vary from distro to
distro, particularly w.r.t. /usr/local/lib :-(