I used conda install -c conda-forge gal to install the GDAL package. However, I got a following error in importing the package.
>>> import gdal
Traceback (most recent call last):
File "", line 1, in
File "/Users/name/anaconda/lib/python3.6/site-packages/gdal.py", line 2, in
from osgeo.gdal import deprecation_warn
File "/Users/name/anaconda/lib/python3.6/site-packages/osgeo/__init__.py", line 21, in
_gdal = swig_import_helper()
File "/Users/name/anaconda/lib/python3.6/site-packages/osgeo/__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
File "/Users/name/anaconda/lib/python3.6/imp.py", line 242, in load_module
return load_dynamic(name, filename, file)
File "/Users/name/anaconda/lib/python3.6/imp.py", line 342, in load_dynamic
return _load(spec)
ImportError: dlopen(/Users/name/anaconda/lib/python3.6/site-packages/osgeo/_gdal.cpython-36m-darwin.so, 2): Library not loaded: @rpath/libicui18n.58.dylib
Referenced from: /Users/name/anaconda/lib/libgdal.20.dylib
Reason: image not found
I tried the followings but they didn't work for me:
conda upgrade numpy
conda install libpng
Does anyone know what I should do?
I use anaconda as well and have also had issues installing GDAL in the past. Instead I usually download a wheel from Christoph Gohlke and do pip install <file_name>.whl and it works.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With