1

I am trying to install a python package from gitlab. I am using pip install git+gitlab_package_address, like here. After that, I am able to import the package. But the package comes with an .so file and later it throws an error: OSError: $LD_LIBRARY_PATH/lib{that_package}.so: cannot open shared object file: No such file or directory.

Manual trial: I can clone the repo via SSH and move into the repo directory. Compile to get the desired lib{that_package}.so (checked that it exists using ls) and using export LD_LIBRARY_PATH=/absolute/path/to/the/repo/directory. Still the same error.

Any help is appreciated.

Peedaruos
  • 61
  • 7
  • `.so` files are architecture dependent; do you know that it was compiled for your OS and hardware? – tripleee Jun 06 '22 at 05:35
  • No how to check that: I can manually compile the c code present in the src with ```gcc``` without an issue. Does that mean it is fine with my OS and hardware? – Peedaruos Jun 06 '22 at 05:40
  • When you compile with `gcc` you are generating a new file. What I'm trying to say is that if the Git repo contained a compiled `.so` file, that is not guaranteed to work on your computer; but if you managed to recompile it locally, that would not be an issue. – tripleee Jun 06 '22 at 05:47
  • Is the error message literal? That looks like it tried to access a directory named `$LD_LIBRARY_PATH` rather than expand the value of the variable with that name. – tripleee Jun 06 '22 at 05:48
  • It's the ```OSError```.. so I guess it wants access to the library (but could never find it) – Peedaruos Jun 06 '22 at 05:55
  • We'd really need to see more debugging details to see where things are going wrong and what exactly you have done so far. – tripleee Jun 06 '22 at 06:04
  • Since `.so` files are build artifacts, they should rarely if ever be put in a repository in the first place. That's probably the (or a) root problem: the package is distributed with a `.so` file but should not be. The `$` sign in the error message suggests additional errors. – torek Jun 06 '22 at 15:53
  • Ya.. I understand the points raised above. It seems that is some issue with git repo's packaging. I am able to do a workaround: I replaced the ```$LD_LIBRARY_PATH/lib{the_package}.so``` with the absolute path of the ```lib{the_package}.so``` (in a file which had this line). And ran the ```setup.py``` again. Now this works.. but is not a solution I was looking for. – Peedaruos Jun 07 '22 at 00:45

0 Answers0