conda-opencv3
conda-opencv3 copied to clipboard
Links against libpng12, conda requirement is for libpng16
On Linux, I installed opencv3
3.2.0 from this channel with Python 3.5. ldd libopencv_xobjdetect.so
shows me:
libpng12.so.0 => /lib64/libpng12.so.0
I.e. it's linking libpng12 from my system outside the conda env. The package itself specifies a dependency on libpng16 (libpng >=1.6.23,<1.7
). As far as I know, conda can't install two versions of libpng in one environment, so this is hard to work around.
On systems with libpng12 installed outside conda, it seems to work correctly. @gamdow discovered this when trying to install on Ubuntu 16.10, which has dropped libpng12 from the repos. conda install opencv3
succeeds, but then the library can't be loaded because libpng12 is missing.
I'm trying to migrate this recipe to conda-forge, just failing at getting Windows builds going. Hopefully those builds should be more stable. OpenCV's build system is a disaster and is really hard to get working (particularly due to the contrib portion). I think I fixed that problem on the conda-forge repo already.
Aha, thanks. We'll try with the package from conda-forge.
@patricksnape Thank you for you reply. But the version of conda-forge is 3.1.0 . Could you please provide a 3.2.0 version please?
@takluyver I try to install libpng12 outside conda by
yum install libpng12
It seems that there is no error when importing.
Yep, if you do that, it can find libpng12 on your system outside conda and load it.
I have the same issue as the OP. After installing OpenCV from menpo, when I try to import cv2
, I get
ImportError: libpng12.so.0: cannot open shared object file: No such file or directory
I didn't have this issue on my previous system and was wondering why I would run into this on a fresh installation, and now I realise why --- I upgraded to Ubuntu 16:10. :-/
Fortunately, it appears conda-forge is now adding builds with gtk2 support, as discussed in this thread. I receive warnings similar to those mentioned there, but no actual errors.
Actually we have no plans at the moment to build with GTK2. But you should use the conda-forge version rather than this one as I maintain both and have only done the 3.2.0 build on conda-forge.