Geodjango Error

1,207 views
Skip to first unread message

vaibhav.g...@gla.ac.in

unread,
Oct 1, 2018, 1:18:15 PM10/1/18
to Django users
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 still I am facing an error showing :

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

You can refer to this error in the attached file.
Can anyone help me out of this.


geodjango error.png

heriberto ochoa

unread,
Oct 1, 2018, 1:23:53 PM10/1/18
to django...@googlegroups.com
Could it be that it does not find a .dll file, what libraries do you use?

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/9fab105c-da54-400a-83bd-6510649078f0%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

vaibhav.g...@gla.ac.in

unread,
Oct 1, 2018, 6:02:18 PM10/1/18
to Django users
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 = '/home/sue/local/lib/libgdal.so'  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.

vaibhav.g...@gla.ac.in

unread,
Oct 1, 2018, 6:05:10 PM10/1/18
to Django users

heriberto ochoa

unread,
Oct 1, 2018, 6:08:48 PM10/1/18
to django...@googlegroups.com

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

Michal Petrucha

unread,
Oct 2, 2018, 2:49:25 AM10/2/18
to django...@googlegroups.com
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA512

On Mon, Oct 01, 2018 at 03:02:18PM -0700, vaibhav.g...@gla.ac.in wrote:
> I have installed PROJ4, GDAL and GEOS libraries using OSGeo4W installer
> <https://trac.osgeo.org/osgeo4w/>. 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 =
> '/home/sue/local/lib/libgdal.so' 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.

If you used '/home/sue/local/lib/libgdal.so', then that would be
incorrect – you write that you're trying to run this on Windows, but
this is a Unix path, so of course Python won't find that file there.

Replace that with the full path to your GDAL DLL, and if you use
backslashes as a directory delimiter, make sure to either use a raw
string literal (r'c:\path\to\my\gdal.dll'), or double-backslashes
('c:\\path\\to\\my\\gdal.dll').

Michal
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1

iQIcBAEBCgAGBQJbsxTVAAoJEHA7T/IPM/klLA0QANjRJZjywvglG74qJQujhyK3
F0FkcN6RVXlwZv2XBq21NufpItQ5kWwnPWEFfA0LwCfIIqrwbsQu2Al1r6xaq29U
uq7cgZDNCfvfMrqnG7sVoqddkJN9taIkl0z+KQtaqg1rsfTdNZa6esKBc062+rCO
HhqrAbHZaUaYkenfvMXp1Qe3GBN6taJ+5banbBoWs1ipeUYK3v+ltLkv8sN4ipHg
Fcj5FKHv1ldt2pE88JvVwGxcrW6cpngKjElZZTjgTDGokC2v7kptCVkkj3KJWPNv
VR+OK0FWwsJdF2uZ3eni9v/MNBTCMe1b8m/ZM6tU2aWW3+8EqznMaX82I+8RMOtS
dPwvTk5To7DwVhm6tQtaO1+abdf/pZ6X76hWwusGbmbCW/Mn04S66CMM+TgVGhSX
LyQZajgYKq6qyt6C/YkNO1wkGNNY8eaDVSotdRMXd9oDpg9xVwx2jwVuGRMBhsVi
2Oou19GTU9GLfOLAC3pEGU3/724ZfLBWP+dCksHtTLrRqU0u9KhEtbrLUrutfDUG
rdWxpmKMjkwyZ7oZt4kLu+ZTEuu2tYU4G770Vq3Z4Ui1HbBYX0QNIEiwhTXehx+a
3vNZ0I5M9idu9kfgrPFmthYb69eWi2cZuPbOMoC1lBm0JrVE5v8L4NwEKx0Itp7u
i/QDsOX/rzuTUQyvnOq3
=VilN
-----END PGP SIGNATURE-----

VAIBHAV GUPTA

unread,
Oct 2, 2018, 7:26:16 AM10/2/18
to django...@googlegroups.com
Yaa I got the error as what you (Michal Petrucha) stated about that the path of  GDAL_LIBRARY_PATH that I had given was of Linux. Now I changed the path (given below)  according to the windows OS  , still the problem is not resolved.
GDAL_LIBRARY_PATH = 'C:\\Users\\gaurav\\Anaconda3\\Lib\\site-packages\\django\\contrib\\gis\\gdal'

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 . 
 
May be that now I have two GDAL libraries, one installed using  OSGeo4W installer and the other using the above link and now they are conflicting.


--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.

heriberto ochoa

unread,
Oct 2, 2018, 3:17:19 PM10/2/18
to Django users
The problem can be with Anaconda3, you installed GDAL in the path of Anaconda3 or in the path de other path of python?, the path of GDAL have all .dll file required

VAIBHAV GUPTA

unread,
Oct 2, 2018, 3:53:41 PM10/2/18
to django...@googlegroups.com
 It is installed automatically at that location. I didn't specified any location.
So according to you, where should I install this GDAL?

heriberto ochoa

unread,
Oct 2, 2018, 4:10:31 PM10/2/18
to Django users
In the path of Anaconda3 where stay python, or in el path default in case of use the traditional installation of python

VAIBHAV GUPTA

unread,
Oct 3, 2018, 5:43:40 PM10/3/18
to django...@googlegroups.com
Still I am not able to get what path should I set so that GDAL could run.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.

To post to this group, send email to django...@googlegroups.com.
Visit this group at https://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/db3aec40-6c9b-4acb-9cc8-2de4f2ef1532%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages