Django migration can't find GDALRaster

荒凉一梦 提交于 2019-12-12 08:54:57

问题


I took over a project with Django, Django REST framework and Leaflet to store drawn path in a database. Installing Django in an virtualenv and trying to migrate it raises:

File "D:\SHK\ElektroClean\venv\lib\site-packages\django\contrib\gis\db\backends\postgis\operations.py", line 7, in from django.contrib.gis.gdal import GDALRaster ImportError: cannot import name 'GDALRaster'

In the directory D:\SHK\ElektroClean\py27\Lib\site-packages\django\contrib\gis\gdal is a folder called raster. Is renaiming this folder to GDALRaster the fix?

Anyone suggestions to fix this?


回答1:


solved did mistakes on installing GDAL -.-

On Linux:

sudo apt-get install libgdal-dev
pip install gdal

On Windows install GDAL Core and GDAL Python bindings from gisinternals



来源:https://stackoverflow.com/questions/39037351/django-migration-cant-find-gdalraster

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