I just did a fresh install of Anaconda3 and am trying to add GDAL/OGR. I've tried installing with both conda install gdal
and conda install -c conda-forge gdal
. In both cases, the install completes successfully, but when I import gdal
, it raises the error:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Users\Jhook\AppData\Local\Continuum\miniconda3\lib\site-packages\gdal.py", line 2, in <module>
from osgeo.gdal import deprecation_warn
File "C:\Users\Jhook\AppData\Local\Continuum\miniconda3\lib\site-packages\osgeo\__init__.py", line 21, in <module>
_gdal = swig_import_helper()
File "C:\Users\Jhook\AppData\Local\Continuum\miniconda3\lib\site-packages\osgeo\__init__.py", line 17, in swig_import_helper
_mod = imp.load_module('_gdal', fp, pathname, description)
File "C:\Users\Jhook\AppData\Local\Continuum\miniconda3\lib\imp.py", line 243, in load_module
return load_dynamic(name, filename, file)
File "C:\Users\Jhook\AppData\Local\Continuum\miniconda3\lib\imp.py", line 343, in load_dynamic
return _load(spec)
ImportError: DLL load failed: The specified module could not be found.
I've found several workarounds out there, but most date back a few years and don't reflect more recent updates or changes. Is there a fix for this problem that works in 2018?
import gdal
, via a terminal or an IDE?import gdal
from a terminal and from PyCharm.from osgeo import gdal
results in the same message