0

I am trying to link to shared objects in the directory /usr/local/depot/anaconda3/lib containing libpython3.5m.so.1.0 using a makefile.

When I try the following makefile:

all: export LD_LIBRARY_PATH=/usr/local/depot/anaconda3/lib

all:
    printenv
    ldd /usr/local/depot/anaconda3/lib/libpython3.5m.so.1.0
    ls ${LD_LIBRARY_PATH}/*libpython*
    /sbin/ldconfig -p | grep python | cut -d\> -f2
    /usr/local/depot/anaconda3/bin/conda

I see the following error while loading shared libraries

System [Fri Aug  9 02:11:15 2019]: Received job XXXX:9999
System [Fri Aug  9 02:11:29 2019]: Success: Driver returned normally
System [Fri Aug  9 02:11:29 2019]: Here is the output from the system:
---
Driver: Job exited with status 2
printenv
SHELL=/bin/bash
_=/usr/bin/driver
container_uuid=9c9cb999-99cb-f99-99f99-9ddd9a999999
PATH=/usr/local/bin:/usr/bin:/bin:/usr/local/sbin:/usr/sbin
container=docker
PWD=/home
HOME=/home/system
LD_LIBRARY_PATH=/usr/local/depot/anaconda3/lib
LOGNAME=system
HOSTNAME=9c9cb99999cb
SHLVL=2
USER=system
MAKEFLAGS=
MFLAGS=
MAKELEVEL=1
ldd /usr/local/depot/anaconda3/lib/libpython3.5m.so.1.0
    linux-vdso.so.1 =>  (0x00007ffc49507000)
    libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f189236e000)
    libdl.so.2 => /lib64/libdl.so.2 (0x00007f189216a000)
    libutil.so.1 => /lib64/libutil.so.1 (0x00007f1891f67000)
    librt.so.1 => /lib64/librt.so.1 (0x00007f1891d5f000)
    libm.so.6 => /lib64/libm.so.6 (0x00007f1891a5d000)
    libc.so.6 => /lib64/libc.so.6 (0x00007f1891690000)
    /lib64/ld-linux-x86-64.so.2 (0x00007f1892a7a000)
ls /usr/local/depot/anaconda3/lib/*libpython*
/usr/local/depot/anaconda3/lib/libpython3.5m.so
/usr/local/depot/anaconda3/lib/libpython3.5m.so.1.0
/usr/local/depot/anaconda3/lib/libpython3.so
/sbin/ldconfig -p | grep python | cut -d\> -f2
 /lib64/libpython3.6m.so.1.0
 /lib64/libpython3.6m.so
 /lib64/libpython3.so
 /lib64/libpython2.7.so.1.0
 /lib64/libpython2.7.so
 /lib64/libpyglib-2.0-python.so.0
 /lib64/libpyglib-2.0-python.so
 /lib64/libboost_python.so.1.53.0
 /lib64/libboost_python.so
 /lib64/libboost_python-mt.so.1.53.0
 /lib64/libboost_python-mt.so
/usr/local/depot/anaconda3/bin/conda
/usr/local/depot/anaconda3/bin/python: error while loading shared libraries: libpython3.5m.so.1.0: cannot open shared object file: No such file or directory
Joseph Konan
  • 666
  • 2
  • 8
  • 18
  • What are you using conda for? Is it just to code in Python? – Zakariah Siyaji Aug 07 '19 at 02:07
  • I eventually need to use jupyter to convert *.ipynb files to *.py files, but that gives me the same error as reproduced above. Specifically: `/usr/local/depot/anaconda3/bin/jupyter nbconvert --to script /home/system/sys/system/given_notebook.ipynb`. – Joseph Konan Aug 07 '19 at 02:13
  • What's with the `all:`? Is that an excerpt from a Makefile or build system? Looks like the environment is not correctly set up at the time `conda` is called. What happens if you call the command from a terminal? _Please add additional information by editing the question, rather than be commenting._ – Roland Weber Aug 07 '19 at 06:21
  • 1
    The documentation of the API I am using is very limited, but I will try to do my best to infer the proper technical terminology and answer your questions. – Joseph Konan Aug 07 '19 at 07:36
  • I've updated the question to be a bit more specific to what I think would resolve my issue... – Joseph Konan Aug 09 '19 at 07:34
  • It may be some OTHER shared library that `libpython3.5m.so.1.0` depends on. Run `LD_LIBRARY_PATH=/usr/local/depot/anaconda3/lib ldd libpython3.5m.so.1.0` to see if all the libraries it depends on are available. – Victor Sergienko Aug 09 '19 at 21:53
  • @Victor Sergienko, I added the results of your suggestion in the post – Joseph Konan Aug 09 '19 at 22:31
  • Maybe `conda` is clearing the environment. Will [the approach with `activate.d/env_vars.sh`](https://stackoverflow.com/questions/46826497/conda-set-ld-library-path-for-env-only) work? – Victor Sergienko Aug 09 '19 at 22:36
  • `/usr/local/depot/anaconda3/envs` starts off as empty. Are you suggesting to create `./etc/conda/activate.d` in `./etc/conda`, then to add `LD_LIBRARY_PATH` to `activate.d/env_vars.sh` in `./etc/conda/activate.d` to fill it? – Joseph Konan Aug 10 '19 at 03:32

0 Answers0