3

I have a mypackage wheel mypackage-py3.7-linux-x86_64 that installs into /usr/local/conda/lib/python3.7/site-packages/mypackage-py3.7-linux-x86_64.egg and adds dependencies:

/usr/local/conda/lib/python3.7/site-packages/libdependencyroot.so
/usr/local/conda/lib/python3.7/site-packages/libdependencydeeper.so

My $LD_LIBRARY_PATH seems to contain everything one would ever need:

echo $LD_LIBRARY_PATH
>>> /usr/local/conda/lib:/usr/local/lib

And than when I try to use

python
import mypackage
...
>>> ImportError: libdependencyroot.so: cannot open shared object file: No such file or directory

If I copy lib files under /usr/local/conda/lib or add /usr/local/conda/lib/python3.7/site-packages/ to LD_LIBRARY_PATH the problem disappears.

Let's say I can go and redesign the mypackage-py3.7-linux-x86_64.whl. What should I do there to make my dependencies discoverable? I don't want to mess with LD_LIBRARY_PATH and I am not sure if it is a fair game for a whl to put things under /usr/local/conda/lib.

y.selivonchyk
  • 8,987
  • 8
  • 54
  • 77
  • 1
    I think this need clarification, or at least a retagging. What is the actual install mechanism? Pip or Conda? If the former, then add `pip` tag; if the latter, then add a `conda-build` tag. Right now the `conda` tag kinda seems out of place. – merv Jan 08 '21 at 22:23
  • So what's actually on the `sys.path`? Everything in site-packages should usually be findable. – wim Jan 08 '21 at 22:40
  • That sort of thing `['', '/usr/local/conda/lib/python3.8', '/usr/local/conda/lib/python3.8/lib-dynload', '/usr/local/conda/lib/python3.8/site-packages', '/usr/local/conda/lib/python3.8/site-packages/mypackage-0.1-py3.8-linux-x86_64.egg']` So, technically `usr/local/conda/lib/python3.8/site-packages` where the dependencies are is already under the path. It might be because one lib.so depends on another lib.so and path is not involved there. But it is a wild guess – y.selivonchyk Jan 08 '21 at 23:07
  • looks like your package installed to python3.7's site but you're using python3.8 . – wim Jan 08 '21 at 23:38
  • Sorry, must have copied from the wrong env. It is the same python – y.selivonchyk Jan 08 '21 at 23:48

0 Answers0