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 ?


Finaly, I solved my problem with this line :

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

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.