python-unrar icon indicating copy to clipboard operation
python-unrar copied to clipboard

Couldn't find path to unrar library

Open DeusMaximus opened this issue 9 years ago • 4 comments

I'm trying desperately to get a Python app working that uses your python-unrar script. I've downloaded the sources from Rarlabs, installed the compiled libunrar.so into /usr/lib, and even set the goddamn UNRAR_LIB_PATH to /usr/lib and pip uninstalled and installed unrar half a dozen times, and goddamnit it still doesn't work.

What the hell is going wrong?

DeusMaximus avatar Apr 08 '15 06:04 DeusMaximus

Managed to resolve this by doing the following (found on some obscure Spanish page):

sudo ln -s /usr/lib/libunrar.so /usr/local/bin/

Is there a reason why this script looks for system libraries in the system binary folder?

DeusMaximus avatar Apr 08 '15 06:04 DeusMaximus

It uses Python's ctypes find_library helper (https://docs.python.org/2/library/ctypes.html#finding-shared-libraries), that is supposed to locate a library in a way similar to what the compiler does. I can check if there is a better way, though.

On the other hand, if setting UNRAR_LIB_PATH, it should be the full path to the file (including the filename): UNRAR_LIB_PATH=/usr/lib/libunrar.so I agree this ^ could be clearer in the docs, will update.

matiasb avatar Apr 08 '15 16:04 matiasb

A bit late, this is an old thread, but after building/installing libunrar with make lib; make install-lib you might also need to run ldconfig so it finds the new library

philborman avatar Nov 17 '18 21:11 philborman

Hi, I am trying to use python_unrar on mac . after downloading unrar_MacOSX_10.13.2_64bit image I set the UNRAR_LIB_PATH in .bash_profile . to fix of the issue for finding the lib path. then in from unrar import rarfile line I am getting the following error AttributeError: dlsym(0x1131589b0, RARGetDllVersion): symbol not found. I put the libunrar.so in /usr/local/bin folder as well. may some one have any clue? thanks

ntaherkhani avatar May 14 '20 17:05 ntaherkhani