pyvips: Cannot locate libvips.so.42
Hello, I just installed vips from source on my system and here are the relevant outputs after the install:
$ ldconfig -p | grep vips
libvips.so.42 (libc6,x86-64) => /usr/local/lib/libvips.so.42
libvips.so (libc6,x86-64) => /usr/local/lib/libvips.so
libvips-cpp.so.42 (libc6,x86-64) => /usr/local/lib/libvips-cpp.so.42
libvips-cpp.so (libc6,x86-64) => /usr/local/lib/libvips-cpp.so
$ echo $LD_LIBRARY_PATH
$LD_LIBRARY_PATH:/usr/local/lib/
$ echo $C_INCLUDE_PATH
$C_INCLUDE_PATH:/usr/local/include/
$ echo $CPLUS_INCLUDE_PATH
$CPLUS_INCLUDE_PATH:/usr/local/include/
$ ls /usr/local/include/
blosc-export.h blosc.h jconfig.h jerror.h jmorecfg.h jpeglib.h openjpeg-2.3 openslide vips zconf.h zlib.h
But after installing pyvips with:
pip install -U git+https://github.com/libvips/pyvips.git
And doing:
import pyvips
I get this error:
>>> import pyvips
Traceback (most recent call last):
File "/home/ekami/Programs/anaconda3/envs/dl/lib/python3.7/site-packages/pyvips/__init__.py", line 19, in <module>
import _libvips
ModuleNotFoundError: No module named '_libvips'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/ekami/Programs/anaconda3/envs/dl/lib/python3.7/site-packages/pyvips/__init__.py", line 70, in <module>
vips_lib = ffi.dlopen(_vips_libname)
File "/home/ekami/Programs/anaconda3/envs/dl/lib/python3.7/site-packages/cffi/api.py", line 146, in dlopen
lib, function_cache = _make_ffi_library(self, name, flags)
File "/home/ekami/Programs/anaconda3/envs/dl/lib/python3.7/site-packages/cffi/api.py", line 828, in _make_ffi_library
backendlib = _load_backend_lib(backend, libname, flags)
File "/home/ekami/Programs/anaconda3/envs/dl/lib/python3.7/site-packages/cffi/api.py", line 823, in _load_backend_lib
raise OSError(msg)
OSError: cannot load library 'libvips.so.42': /usr/lib/librsvg-2.so.2: undefined symbol: cairo_tag_end. Additionally, ctypes.util.find_library() did not manage to locate a library called 'libvips.so.42'
I’m on Manjaro (Arch linux) and my conda env is using Python 3.7.2. Any idea how I can solve this? Thank you.
About this issue
- Original URL
- State: closed
- Created 5 years ago
- Comments: 16 (5 by maintainers)
It does not work for me
guys, if you are on ubuntu, doing everything required for pip and conda is not enough, i had to run
sudo apt install libvipsfor it to workYes that’s a classic conda / non-conda problem 😦 It’s very unfortunate that there are at least four versions of libjpeg in common use, and you (often) can’t mix them in one executable.
Wait until you try to load something via libMagick.
With API mode, it generates some C for the bottom parts of the binding at install time, then builds, then calls the C to communicate with libvips. It needs the libvips headers to be able to do this.
In ABI mode, everything is done in Python (eg. even assembling the stack frame ready to call into the lib) and all it needs is the libvips.so shared library.
If you process big images, the extra call overhead is unimportant. If you are doing lots of operations on smaller images, it can be noticeable.
There is actually a cleaner solution to the ugly one I found. Just use:
And you’re done 😃
Working perfectly well so far. Feel free to close this discussion @jcupitt if you think it’s all you need from me to help other people with the same issue.