i'm using OSGeo4W64 (gdal 2.0.2-8) with Python 2.7.5 on Windows 8.1 64bit. Editor is PyCharm 2016.1.2.
I want to save an image with gdal, but i always get an error when the python script is complete. The following example causes the error:
from osgeo import gdal import numpy as np path = 'D:\\test.tiff' data = np.array([]) sizeY = int(data.shape) sizeX = int(data.shape) bandCount = 1 driver = gdal.GetDriverByName("GTiff") dataSet = driver.Create(path, sizeX, sizeY, bandCount, gdal.GDT_Byte) band = dataSet.GetRasterBand(1) band.WriteArray(data) # causes error, if commented out, everything is fine band = None dataSet = None print "the appcrash will come next"
I'm dereferencing the vars and it should be fine, but i'm getting "python.exe has stopped working".
The console shows:
the appcrash will come next Process finished with exit code -1073741819 (0xC0000005)
When i run the code in QGIS (2.14.1) and i close QGIS, a similar error occurrs and a dump file was created.
Process Name: qgis-bin.exe : C:\OSGeo4W64\bin\qgis-bin.exe Process Architecture: x64 Exception Code: 0xC0000005 Exception Information: The thread tried to read from or write to a virtual address for which it does not have the appropriate access.
My GDAL-Enviroment-Vars are:
I have no idea why this error happens (maybe something with the dereferencing). The error might be similar to here.