GeoDjango on Windows: “Could not find the GDAL library” / “OSError: [WinError 126] The specified module could not be found”

后端 未结 8 1542
青春惊慌失措
青春惊慌失措 2020-11-28 06:58

I\'ve been trying to setup my windows computer such that I can have a local postgreSQL with PostGIS extension. With this installed I hope to be able to create a project with

8条回答
  •  南方客
    南方客 (楼主)
    2020-11-28 07:58

    Just to follow up on the nice and detailed answer of Udi (cannot comment directly as my rep is under 50, it is the answer marked as the most useful);

    After many hours I tried his offered solution which also did not work for me. I was getting the following error:

    OSError: [WinError 193] %1 is not a valid Win32 application
    

    But I stayed there and found out that although I'm running 64 python and operating system (for sure), it kept looking for 32 bit (OSGeo4W) folder. What eventually let me pass was to copy contents of the OSGeo4W64 folder to the OSGeo4W. Hope it will save you time.

    One more note:

    Be sure that you edit libgdal.py file in your environment folder. It may exist in more than one place - your python folder and environment folder - if you edit the libgdal in your python dir, it is not going to work.

提交回复
热议问题