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

后端 未结 8 1537
青春惊慌失措
青春惊慌失措 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:54

    I had the same error "The specified module could not be found," even though gdal204.dll was present at the expected location, with the right architecture (which I verified by adding asserts in the Python code and loading the DLL from a C program).

    It turned out to be an issue with the Python 3.7 app from the Microsoft Store, the one that automatically installs the first time you type python on the command line. This version of Python refuses to load the GDAL DLL; I don't know if it's a bug or a security feature.

    I fixed the issue by:

    • uninstalling the Python app
    • removing the app execution aliases (as explained in the app description)
    • installing the regular Python package from python.org

提交回复
热议问题