Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Django migration can't find GDALRaster

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?

like image 392
Trevirius Avatar asked Dec 24 '22 02:12

Trevirius


1 Answers

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

like image 84
Trevirius Avatar answered Dec 26 '22 14:12

Trevirius