GeoDjango could not find GDAL library in Windows 10

家住魔仙堡 提交于 2019-12-01 05:20:54

I fixed this by editing the libgdal.py file in %PYTHONPATH%\Lib\site-packages\django\contrib\gis\gdal and adding str('gdal202') to line 26 so it reads:

 lib_names = [str('gdal201'), str('gdal202'), str('gdal111'), str('gdal110'), str('gdal19')]

Depending on what version of GDAL you are using, you may need to add a different version number.

I had the same problem, and for me the issue was I had started my cmd shell before updating the PATH environment variable used to search for the GDAL library. I just had to restart my shell and everything worked.

After trying many solutions, including reinstalling, adding to paths etc, I found this relatively simple solution which worked for me.

https://stackoverflow.com/a/49159195/3768552

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!