I have created a simple QGIS script using QGIS 2.18.3 and windows 10 and it works fine without errors.But I want to move that script to another PC where I have QGIS 2.6 and windows 7.
I first copy-paste my plugin in .qgis2 to the other PC and QGIS loads this script without errors but if try to execute the script then I take that error :
minidump written to C:
\users\username\AppData\Local\Temp\qgis-20170316-131340-2756-3012-e2a51df.dmp
Any idea why? In the plugin I have more pushbutton where show some details that button works but it doesn't work in the final execute? Maybe it's the Windows user's permission?
UPDATE : PLUGIN CODE
my plugin is simple for test:
fileInfo = QFileInfo(input)
baseName = fileInfo.baseName()
filePath = str(os.path.abspath(input))
rlayer = QgsRasterLayer(filePath, baseName)
or i try that code from this post:
from qgis.core import QgsRasterLayer
from PyQt4.QtCore import QFileInfo
def StringToRaster(raster):
# Check if string is provided
fileInfo = QFileInfo(raster)
path = fileInfo.filePath()
baseName = fileInfo.baseName()
layer = QgsRasterLayer(path, baseName)
QgsMapLayerRegistry.instance().addMapLayer(layer)
if layer.isValid() is True:
print "Layer was loaded successfully!"
else:
print "Unable to read basename and file path - Your string is probably invalid"
raster = '/home/zeito/Desktop/output2.tif'
StringToRaster(raster)