pycharm: this application failed because no QT plugin platform could be initialised

已回答

hello, as a newby interested in QGis programming with phyton (for plugins, standalone Qgis apps)

I tried Pycharm (edu version) as an QGis IDE.

Then doing the following simple  test: (from http://planet.qgis.org/planet/tag/pycharm/)

"from qgis.core import QgsApplication
from PyQt4.QtGui import QDialog

GUIEnabled=True
app = QgsApplication([], GUIEnabled)

dlg = QDialog()
dlg.exec_()

app.exit(app.exec_())"

changing a bit:
(I'm using QGis 3.4, Python3.7, which use PyQt5 I think)

from PyQt5.QtGui import QDialog
or
from PyQt5.QtWidgets import QtGui
from PyQt5.QtGui import QDialog
or any other similar combination I could think off
...

over and over the following  message:

"this application failed because no QT plugin platform could be initialised"

or sometimes:

"could not find QtdDialog"

Same message (the first message) in Eclipse IDE also.

No solution found afters 4-5 hours searching on internet - strange because looks like a quite basic fault message to me,
with probably (hopefully) a straightforward solution ?
(no solution on the net maybe because I use the newest QGis version ?: most posts are older..2017 or earlier..)

I added to pythonpath and path variables a lot (i mean a lot) of additional paths...

Thanks for any suggestion.

Please remember I'm a newbie not aan IT-wizard.

 

 

 

0

Hi,

If you are having the same problem outside of PyCharm, then it means that the problem is not related to PyCharm and you should solve the problem in the system/environment or your code.

Tip: You could try reinstalling Qt, maybe that could help.

0
Avatar
Permanently deleted user

Hi,

I have the same issue in the cmd and PyCharm. Did you resolved the problem?

0

请先登录再写评论。