Search code examples
condacentos7gdal

Where can I find libLerc.so.4 library for CentOS 7?


While working from terminal in conda environment:

gdalinfo filename

Error is:

Gdalinfo: error while loading shared libraries:
  libLerc.so.4: cannot open shared object file: No such file or directory

GDAL is installed with conda. There is no library like that. On CentOS Linux release 7.9.2009 (Core)

GDAL version is 3.5.3.

Here: https://pkgs.org/search/?q=Raster%20Compression I can't find any package like liblerc to install What package should be installed to fix this?


Solution

  • Missing library errors are often due to improperly mixing channels. Installing gdal in a fresh environment with conda-forge channel prioritized works just fine. E.g.,

    $ mamba create -n foo -c conda-forge gdal
    $ mamba activate foo
    (foo) $ gdalinfo --version
    GDAL 3.6.2, released 2023/01/02
    

    We can also track down the package that normally provides the file OP is missing using conda package --which:

    (foo) $ conda package --which ${CONDA_PREFIX}/lib/libLerc.so.4
    /opt/conda/envs/foo/lib/libLerc.so.4       conda-forge/linux-64::lerc-4.0.0-h27087fc_0
    

    That is, the Conda Forge package lerc installs this file.