[gdal-dev] Help with getting gdal python module working

Candy, Liam Liam.Candy at angloamerican.com
Mon May 15 05:55:29 PDT 2017


Hi,

I've managed to get GDAL 2.1.3 to build with ECW 5.3 support on my 64-bit system. The last hurdle I'm struggling with is getting the python module to install and work. The lines in my nmake.opt file relating to python are;

!IFNDEF PYDIR
PYDIR = "... \AppData\Local\Programs\Python\Python36"
!ENDIF


HAVE_NUMPY=1

But the python module does not install.
I've tried going into the gdal-2.1.3\swig\python folder and installing manually with "python setup.py install", but when I try to import gdal in a script with "from osgeo import gdal" I get the error

Traceback (most recent call last):
  File "...\AppData\Local\Programs\Python\Python36\lib\site-packages\IPython\core\interactiveshell.py", line 2881, in run_code
    exec(code_obj, self.user_global_ns, self.user_ns)
  File "<ipython-input-3-a04b80bf4e65>", line 1, in <module>
    from osgeo import gdal
  File "D:\Program Files (x86)\JetBrains\PyCharm Community Edition 2016.3.2\helpers\pydev\_pydev_bundle\pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
  File "...\Local\Programs\Python\Python36\lib\site-packages\gdal-2.1.3-py3.6-win-amd64.egg\osgeo\__init__.py", line 21, in <module>
    _gdal = swig_import_helper()
  File "...\Local\Programs\Python\Python36\lib\site-packages\gdal-2.1.3-py3.6-win-amd64.egg\osgeo\__init__.py", line 17, in swig_import_helper
    _mod = imp.load_module('_gdal', fp, pathname, description)
  File "...\Local\Programs\Python\Python36\Lib\imp.py", line 242, in load_module
    return load_dynamic(name, filename, file)
  File "...\Local\Programs\Python\Python36\Lib\imp.py", line 342, in load_dynamic
    return _load(spec)
ImportError: DLL load failed: The specified module could not be found.

Which I'm assuming is because the GDAL scripts can't find the relevant GDAL dlls.

Any idea on how to fix this ?

Best regards,
Liam.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/gdal-dev/attachments/20170515/6a64abf9/attachment-0001.html>


More information about the gdal-dev mailing list