natcap / invest

InVEST®: models that map and value the goods and services from nature that sustain and fulfill human life.
Apache License 2.0
166 stars 68 forks source link

Mac builds are currently failing on GDAL/libwebp import #63

Closed phargogh closed 4 years ago

phargogh commented 4 years ago

To reproduce:

  1. On a mac, create a conda environment: conda create -p ./env37-conda python=3.7 "gdal<3"
  2. conda activate ./env37-conda
  3. python -c "from osgeo import gdal"
  4. Observe exception like this one:
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/Users/jdouglass/Downloads/logs_111/Build mac binaries/env37-conda/lib/python3.7/site-packages/osgeo/__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "/Users/jdouglass/Downloads/logs_111/Build mac binaries/env37-conda/lib/python3.7/site-packages/osgeo/__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
  File "/Users/jdouglass/Downloads/logs_111/Build mac binaries/env37-conda/lib/python3.7/imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "/Users/jdouglass/Downloads/logs_111/Build mac binaries/env37-conda/lib/python3.7/imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: dlopen(/Users/jdouglass/Downloads/logs_111/Build mac binaries/env37-conda/lib/python3.7/site-packages/osgeo/_gdal.cpython-37m-darwin.so, 2): Library not loaded: @rpath/libwebp.7.dylib
  Referenced from: /Users/jdouglass/Downloads/logs_111/Build mac binaries/env37-conda/lib/libtiff.5.dylib
  Reason: Incompatible library version: libtiff.5.dylib requires version 9.0.0 or later, but libwebp.7.dylib provides version 8.0.0

This is currently happening in PR builds. Examples:

phargogh commented 4 years ago

It would appear that the libwebp package available in conda-forge is out-of-date with respect to what's in the default conda channel. Within the activated environment described in the original post, running conda upgrade libwebp causes the correct version of libwebp to be installed and the import error to go away.

phargogh commented 4 years ago

Resolved in https://github.com/natcap/invest/pull/65