TransWikia.com

QGIS qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even

Geographic Information Systems Asked by LukeNukem on July 22, 2021

I run often Metshape software from QGIS app, however I recently encounter a problem.
I use this script:

import sys
import os
script_path = "D:/script.py"
commandline = '"C:/Program Files/Agisoft/Metashape Pro/metashape.exe"' + " -r " + script_path
timer_value = 10
os.system(commandline + " & timeout " + str(timer_value))

This script run perfectly with python 3.6 but in QGIS app, I have this error :

qt.qpa.plugin: Could not load the Qt platform plugin "windows" in "" even though it was found.
This application failed to start because no Qt platform plugin could be initialized. Reinstalling the application may fix this problem.
Available platform plugins are: direct2d, minimal, offscreen, windows.

Can anyone guess ?

One Answer

Finaly, I solved my problem with this line :

os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = "C:/Program Files/Agisoft/Metashape Pro/plugins/platforms"

Correct answer by LukeNukem on July 22, 2021

Add your own answers!

Ask a Question

Get help from others!

© 2024 TransWikia.com. All rights reserved. Sites we Love: PCI Database, UKBizDB, Menu Kuliner, Sharing RPP