5

Currently, I am working on Geodjango. I have gone through all the procedures written in https://docs.djangoproject.com/en/2.1/ref/contrib/gis/install/#requirements for windows OS. But now I am facing an error showing :

OSError: [WinError 126] The specified module could not be found

[You can see this error in this image.][1]

I have installed PROJ4, GDAL and GEOS libraries using OSGeo4W installer. But the problem is with GDAL library. Earlier there was an error showing :-

django.core.exceptions.ImproperlyConfigured: Could not find the GDAL library (tried "gdal202", "gdal201", "gdal20", "gdal111", "gdal110", "gdal19"). Is GDAL installed? If it is, try setting GDAL_LIBRARY_PATH in your settings.

Then after setting the path using

GDAL_LIBRARY_PATH =  'C:\\Users\\gaurav\\Anaconda3\\Lib\\site-packages\\django\\contrib\\gis\\gdal'

in settings.py file the error changes to what I have stated before which is :-

OSError: [WinError 126] The specified module could not be found.

Also I have reinstalled GDAL from https://sandbox.idre.ucla.edu/sandbox/tutorials/installing-gdal-for-windows and followed all the steps provided in this website, but still the problem is not resolved.

Now I have given this path

GDAL_LIBRARY_PATH = 'C:\\Program Files\\GDAL\\gdal203.dll' 

in settings.py . But still the problem is not resolved. Can anyone help me out of this.

Armali
  • 18,255
  • 14
  • 57
  • 171
VAIBHAV GUPTA
  • 51
  • 1
  • 4
  • Try this solution: https://stackoverflow.com/a/49159195/57952 – Udi Oct 02 '18 at 17:30
  • Possible duplicate of [GeoDjango on Windows: "Could not find the GDAL library" / "OSError: \[WinError 126\] The specified module could not be found"](https://stackoverflow.com/questions/49139044/geodjango-on-windows-could-not-find-the-gdal-library-oserror-winerror-12) – Udi Oct 02 '18 at 17:32
  • did anyone every get this resolved? I have the exact same issue, and the link provided by @Udi has not solved the problem for me. I get the same "specified module could not be found" error no matter what. – Shawn Apr 29 '19 at 14:26
  • I switched myself towards Ubuntu 18.04. It worked well there.No compatibility issues. – VAIBHAV GUPTA Jul 13 '19 at 19:26
  • 1
    For me, what worked was set the DLL as gdal204.dll, as for python 3.7 this is the right dll to use. On 3.6 is gdal202.dll – Gustavo Gonçalves Aug 16 '19 at 19:15

0 Answers0