Failed to extract plugin meta data from qtquick2plugin.dll in pyside application
Asked Answered
S

2

2

I have my first qt quick 2 pyside application,my app don't run and show below error

main.py file

import sys,os
from PySide6.QtGui import QGuiApplication
from PySide6.QtQml import QQmlApplicationEngine
import PySide6

if __name__ == "__main__":
    #==== [ spcify where is plugins of windows ] ===
    dirname=os.path.dirname(PySide6.__file__)
    plugin_path = os.path.join(dirname, 'plugins', 'platforms')
    os.environ['QT_QPA_PLATFORM_PLUGIN_PATH'] = plugin_path
    #==================================================
    app = QGuiApplication(sys.argv)
    engine = QQmlApplicationEngine()
    engine.load(os.path.join(os.path.dirname(__file__), "main.qml"))
    if not engine.rootObjects():
        sys.exit(-1)
    sys.exit(app.exec_())

main.pyproject file

{
    "files": ["main.qml","main.py"]
}

I am using C:\Users\MyUserName\anaconda3\python.exe for compiling

Application output

13:34:50: Starting C:\Users\MyUserName\anaconda3\python.exe -u D:\QtProjects\qtforpythonprojects\MyFirstApp\main.py...
Found invalid metadata in lib C:/Users/MyUserName/anaconda3/Library/plugins/platforms/qdirect2d.dll: Invalid metadata version
Found invalid metadata in lib C:/Users/MyUserName/anaconda3/Library/plugins/platforms/qminimal.dll: Invalid metadata version
Found invalid metadata in lib C:/Users/MyUserName/anaconda3/Library/plugins/platforms/qoffscreen.dll: Invalid metadata version
Found invalid metadata in lib C:/Users/MyUserName/anaconda3/Library/plugins/platforms/qwindows.dll: Invalid metadata version
Found invalid metadata in lib C:/Users/MyUserName/anaconda3/Library/qml/QtQuick.2/qtquick2plugin.dll: Invalid metadata version
QQmlApplicationEngine failed to load component
file:///D:/QtProjects/qtforpythonprojects/MyFirstApp/main.qml:1:1: Failed to extract plugin meta data from 'C:/Users/MyUserName/anaconda3/Library/qml/QtQuick.2/qtquick2plugin.dll'
13:34:52: C:\Users\MyUserName\anaconda3\python.exe exited with code -1
Subclinical answered 5/3, 2021 at 10:50 Comment(1)
It seems to me that it is an anaconda bug (of the many they have with respect to Qt) so I recommend you report itCracy
S
2

I was using Python 3.8 and based on qt docs this version was missing some Api so I installed last version of python(3.9) and now the problem is solved :>

Note

Python 3.8.0 was missing some API required for PySide/Shiboken so it’s not possible to use it for a Windows build.

Subclinical answered 6/3, 2021 at 16:13 Comment(1)
how did you get to work? I installed miniconda with python 3.9, install Qt from their site and pyqt5 with pip. And I still get the same dll files problem.Putamen
A
0

Although I am not using PySide, perhaps this could help, because I had the same invalid metadata error.

I installed opencv with

conda install python=3.8 # installing 3.8.13
conda install opencv

which led to this error.

Going back to a normal pip install worked:

conda install python=3.8
pip install opencv-python
Augmenter answered 13/9, 2022 at 4:33 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.