Skip to content

Conda environment broken

Description

Installing otb via conda from a clean environment results in a broken otb installation due to a missing libshark.

Steps to reproduce

Executing the following commands on my machine (Ubuntu 18.04.2) and conda 4.8.3 results in the error:

conda create --name=otbenv python=3.8
conda activate otbenv
conda install -c orfeotoolbox otb
python -c "import otbApplication; print(str(otbApplication.Registry.GetAvailableApplications()))"

This gives the following output:

2020-05-13 11:30:13 (WARNING): Failed to load libraries from /home/akynos/anaconda2/envs/biophy_otb3/lib/otb/applications/otbapp_TrainVectorClassifier.so while trying to create application TrainVectorClassifier
because: -> libshark.so.0: cannot open shared object file: No such file or directory
2020-05-13 11:30:13 (WARNING): Failed to load libraries from /home/akynos/anaconda2/envs/biophy_otb3/lib/otb/applications/otbapp_VectorClassifier.so while trying to create application VectorClassifier
because: -> libshark.so.0: cannot open shared object file: No such file or directory
[...]
Segmentation fault (core dumped)

Installing libshark-dev from apt does not resolve the error due to a version mismatch. However, I did find that libshark is already included in the package, except it is located in lib64 and not lib. The error can thus be resolved by executing the following lines:

ln -s [...]/anaconda2/envs/otbenv/lib64/libshark.so* [...]/anaconda2/envs/otbenv/lib/

Configuration information

  • OTB 7.1.0 from conda
  • Ubuntu 18.04.2 LTS
  • Clean Python 3.8 conda env
  • Conda 4.8.3 (any should work)
Edited by Peter Kettig