LD_LIBRARY_PATH ignorado por Python 2.7

Estoy intentando instalar Theano en un cuadro para el que no tengo acceso de administrador y parece que LD_LIBRARY_PATH es ignorado por mi installation de Python 2.7. Como no puedo instalar packages a nivel de sistema, decidí comstackr todos los packages (Python, SciPy, OpenBLAS y otros) desde el origen e instalarlos en $ HOME. Mientras probaba SciPy, recibí el error ERROR: Failure: ImportError (libopenblas.so.0: cannot open shanetworking object file: No such file or directory) pero parece que la biblioteca está presente y LD_LIBRARY_PATH apunta a la carpeta correcta. Aquí está la transcripción completa:

 wheatstone-acogliat 42% echo $LD_LIBRARY_PATH /home/seas/grad/acogliat/lib wheatstone-acogliat 43% python -c "import scipy; scipy.test()" Running unit tests for scipy NumPy version 1.9.3 NumPy is installed in /home/seas/grad/acogliat/lib/python2.7/site-packages/numpy SciPy version 0.16.0 SciPy is installed in /home/seas/grad/acogliat/lib/python2.7/site-packages/scipy Python version 2.7.10 (default, Sep 28 2015, 21:06:05) [GCC 4.1.2 20080704 (Red Hat 4.1.2-55)] nose version 1.3.7 /home/seas/grad/acogliat/lib/python2.7/site-packages/numpy/lib/utils.py:95: DeprecationWarning: `scipy.weave` is deprecated, use `weave` instead! warnings.warn(depdoc, DeprecationWarning) E.......................................................................K.......................................................................................................EEEEEEEEE.....................................................................................................EE......................................................................S...........EEE...........................................K...................................................................................................... ====================================================================== ERROR: Failure: ImportError (libopenblas.so.0: cannot open shanetworking object file: No such file or directory) ---------------------------------------------------------------------- Traceback (most recent call last): File "/home/seas/grad/acogliat/lib/python2.7/site-packages/nose/loader.py", line 418, in loadTestsFromName addr.filename, addr.module) File "/home/seas/grad/acogliat/lib/python2.7/site-packages/nose/importer.py", line 47, in importFromPath return self.importFromDir(dir_path, fqname) File "/home/seas/grad/acogliat/lib/python2.7/site-packages/nose/importer.py", line 94, in importFromDir mod = load_module(part_fqname, fh, filename, desc) File "/home/seas/grad/acogliat/lib/python2.7/site-packages/scipy/cluster/__init__.py", line 27, in <module> from . import vq, hierarchy File "/home/seas/grad/acogliat/lib/python2.7/site-packages/scipy/cluster/vq.py", line 89, in <module> from . import _vq ImportError: libopenblas.so.0: cannot open shanetworking object file: No such file or directory [...MULTIPLE SIMILAR ERRORS OMITTED...] FAILED (KNOWNFAIL=2, SKIP=1, errors=15) wheatstone-acogliat 44% ls -al $LD_LIBRARY_PATH total 47232 drwxr-sr-x 6 acogliat eestudent 512 Sep 28 22:58 ./ drwxr-sr-x 19 acogliat eestudent 512 Sep 28 23:29 ../ drwxr-sr-x 3 acogliat eestudent 512 Sep 28 22:58 cmake/ lrwxrwxrwx 1 acogliat eestudent 30 Sep 28 22:58 libopenblas.a -> libopenblas_opteronp-r0.2.14.a -rw-r--r-- 1 acogliat eestudent 25211324 Sep 28 22:57 libopenblas_opteronp-r0.2.14.a -rwxr-xr-x 1 acogliat eestudent 12826920 Sep 28 22:57 libopenblas_opteronp-r0.2.14.so* lrwxrwxrwx 1 acogliat eestudent 31 Sep 28 22:58 libopenblas.so -> libopenblas_opteronp-r0.2.14.so* lrwxrwxrwx 1 acogliat eestudent 31 Sep 28 22:58 libopenblas.so.0 -> libopenblas_opteronp-r0.2.14.so* -r-xr-xr-x 1 acogliat eestudent 10193546 Sep 28 21:36 libpython2.7.a* drwxr-sr-x 3 acogliat eestudent 512 Sep 28 22:46 perl5/ drwxr-sr-x 2 acogliat eestudent 512 Sep 28 21:36 pkgconfig/ drwxr-sr-x 28 acogliat eestudent 14336 Sep 28 21:36 python2.7/ wheatstone-acogliat 45% uname -a Linux wheatstone 2.6.18-404.el5 #1 SMP Tue Apr 7 12:42:54 EDT 2015 x86_64 x86_64 x86_64 GNU/Linux 

¿Qué me estoy perdiendo?

Si el código llama explícitamente a dlopen() para search files, usará LD_LIBRARY_PATH, aunque python normal usa $PYTHONPATH para search modules y bibliotecas. También puede establecer la matriz sys.path :

 import sys sys.path.append('/mydir') 

Recuerde exportar LD_LIBRARY_PATH o PYTHONPATH.