I run my exe on cmd by passing argument and get this error:
Cannot mix incompatible Qt library (version 0x50902) with this library (version 0x50901)
How can I fix the problem?
It is an standalone application and I give the path on cmd window at the beginning like that (my exe file name is "path2Shape"):
path2Shape.py C:\Users\Mustafa Uçar\Desktop\Tutorial\Mississippi\mississippi.shp
Here is my code of the exe file:
import sys
from qgis.core import *
from qgis.gui import *
from PyQt5.QtCore import *
from PyQt5 import QtGui
app = QgsApplication([], True)
path = "C:/OSGeo4W64/apps/qgis-dev"
app.setPrefixPath(path, True)
app.initQgis()
canvas = QgsMapCanvas()
title = "PyQGIS Standalone Application Example"
canvas.setWindowTitle(title)
canvas.setCanvasColor(Qt.white)
filepath = sys.argv[0]
layer = QgsVectorLayer(filepath, "testlayer", "ogr")
QgsProject.instance().addMapLayer(layer)
canvas.setExtent(layer.extent())
canvas.setLayers([layer])
canvas.zoomToFullExtent()
canvas.show()
sys.exit(app.exec_())