1

I have found a lot of questions similar to this on stackoverflow. The most relevant is Unable to install Python and GDAL (DLL load failed).

I followed the steps in the accepted answer to that question and also steps from the other replies. I uninstalled and reinstalled the proper versions and checked the environment variables multiple times. I've also placed 'C:\Program Files (x86)\GDAL' at the beginning of my Path variable.

Here is an example of the error I get (running Windows 7): Screenshot of error message

I downloaded and installed "gdal-201-1500-core.msi" from the GISinternals website which is the correct GDAL version for my installed python version, and then I installed "GDAL-2.1.0.win32-py2.7.msi" for the python bindings.

After installation, I added the system variables.

GDAL_DATA = C:\Program Files (x86)\GDAL\gdal-data
GDAL_DRIVER_PATH = C:\Program Files (x86)\GDAL\gdalplugins
Path = C:\Program Files (x86)\GDAL; etc...

I verified that the GDAL data folder is indeed named "gdal-data" and not "gdal_data". I placed GDAL at the beginning of the Path variable. GDAL works in the command prompt. The command gdalinfo --version provides the proper version information. The same command also works in IPython. However, when I try to import osgeo, it fails as in the picture above. The 'osgeo' module is listed as being present when help("modules") is entered in iPython.

I found another potential solution (I can't provide the website due to the link limit). It recommended installing a "dependency walker" program. I ran the program and opened C:\Program Files (x86)\GDAL\gdalwarp.exe and it came up with the following errors: dependency walker info

In a nutshell, GDAL works on my computer but I can't import osgeo into Python. From the dependency walker program, it looks like I might be missing 'L1-1-0.DLL'. Maybe this is the problem?

Community
  • 1
  • 1
nick
  • 11
  • 1
  • Possible duplicate of [ImportError: No module named gdal](http://stackoverflow.com/questions/35500176/importerror-no-module-named-gdal) – Benjamin Feb 07 '17 at 15:43
  • I ended up using Anaconda to install python locally. Then I installed an environment for python 3.4 and installed GDAL from conda-forge. This allowed me to successfully import GDAL. The process works for python 2.7 as well. – nick Nov 01 '17 at 18:56

0 Answers0