Search code examples
pythoncondadistutils

LD_LIBRARY_PATH in Conda environment


I create a Conda environment (myenv), and build a Python extension (using distutils) in this env. My library uses some libraries which exist on both /usr/local/lib and /home/user/miniconda3/envs/myenv/lib.

In myenv, LD_LIBRARY_PATH is empty, but ldd mylib.so shows that my library links to libraries in /home/user/miniconda3/envs/myenv/lib. This makes sense but I wonder why it doesn't link to libraries in /usr/local/lib?


Solution

  • I found that path $ORIGIN/../lib was set in RPATH of python in myenv.