I have trying to run python script from the terminal but getting the next error message :
ImportError: libpython2.7.so.1.0: cannot open shared object file: N
This isn't a subject I'm keen on, but my understanding is for Linux machines especially (where you're compiling python binaries) that shared library directories should be specified at the compile step.
For instance, following the linked example, here is how I ensure libpython2.7.so.1.0
is included in addition to other libraries:
./configure --enable-shared \
--prefix=/directory/for/Python-2.7.15 \
LDFLAGS="-Wl,--rpath=/usr/local/lib -Wl,--rpath=/directory/for/Python-2.7.15"
Notice I'm also installing python to a fixed directory of my choosing, via the --prefix
option. That might not be necessary for you, but I did it to provide a solution for the general case where your python install might be located anywhere.
With the above solution, I never have to export LD_LIBRARY_PATH
or mess with ldconfig