Простой пример Hello World, взятый из https://doc.qt.io/qtforpython/tutorials/basictutorial/widgets.html
from PySide2.QtWidgets import QApplication, QLabel
import sys
import os
# Set environment variables
os.environ['QT_DEBUG_PLUGINS'] = '1'
app = QApplication(sys.argv)
label = QLabel("Hello World!")
label.show()
app.exec_()
Я получаю сообщение об ошибке ниже:
[Running] python -u "/home/msingh/Programming/Python/Oreilly Python Beyond The Basics - Object Oriented Programming/8-Defining A Class.py"
Warning: Ignoring XDG_SESSION_TYPE=wayland on Gnome. Use QT_QPA_PLATFORM=wayland to run on Wayland anyway.
QFactoryLoader::QFactoryLoader() checking directory path "/home/msingh/anaconda3/plugins/platforms" ...
QFactoryLoader::QFactoryLoader() looking at "/home/msingh/anaconda3/plugins/platforms/libqeglfs.so"
Found metadata in lib /home/msingh/anaconda3/plugins/platforms/libqeglfs.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"eglfs"
]
},
"className": "QEglFSIntegrationPlugin",
"debug": false,
"version": 329991
}
Got keys from plugin meta data ("eglfs")
QFactoryLoader::QFactoryLoader() looking at "/home/msingh/anaconda3/plugins/platforms/libqminimal.so"
Found metadata in lib /home/msingh/anaconda3/plugins/platforms/libqminimal.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"minimal"
]
},
"className": "QMinimalIntegrationPlugin",
"debug": false,
"version": 329991
}
Got keys from plugin meta data ("minimal")
QFactoryLoader::QFactoryLoader() looking at "/home/msingh/anaconda3/plugins/platforms/libqminimalegl.so"
Found metadata in lib /home/msingh/anaconda3/plugins/platforms/libqminimalegl.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"minimalegl"
]
},
"className": "QMinimalEglIntegrationPlugin",
"debug": false,
"version": 329991
}
Got keys from plugin meta data ("minimalegl")
QFactoryLoader::QFactoryLoader() looking at "/home/msingh/anaconda3/plugins/platforms/libqoffscreen.so"
Found metadata in lib /home/msingh/anaconda3/plugins/platforms/libqoffscreen.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"offscreen"
]
},
"className": "QOffscreenIntegrationPlugin",
"debug": false,
"version": 329991
}
Got keys from plugin meta data ("offscreen")
QFactoryLoader::QFactoryLoader() looking at "/home/msingh/anaconda3/plugins/platforms/libqvnc.so"
Found metadata in lib /home/msingh/anaconda3/plugins/platforms/libqvnc.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"vnc"
]
},
"className": "QVncIntegrationPlugin",
"debug": false,
"version": 329991
}
Got keys from plugin meta data ("vnc")
QFactoryLoader::QFactoryLoader() looking at "/home/msingh/anaconda3/plugins/platforms/libqxcb.so"
Found metadata in lib /home/msingh/anaconda3/plugins/platforms/libqxcb.so, metadata=
{
"IID": "org.qt-project.Qt.QPA.QPlatformIntegrationFactoryInterface.5.3",
"MetaData": {
"Keys": [
"xcb"
]
},
"className": "QXcbIntegrationPlugin",
"debug": false,
"version": 329991
}
Got keys from plugin meta data ("xcb")
QFactoryLoader::QFactoryLoader() checking directory path "/home/msingh/anaconda3/bin/platforms" ...
Cannot load library /home/msingh/anaconda3/plugins/platforms/libqxcb.so: (/home/msingh/anaconda3/plugins/platforms/../../lib/libQt5XcbQpa.so.5: symbol _ZN11QFontEngine14bitmapForGlyphEj6QFixedRK10QTransform version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)
QLibraryPrivate::loadPlugin failed on "/home/msingh/anaconda3/plugins/platforms/libqxcb.so" : "Cannot load library /home/msingh/anaconda3/plugins/platforms/libqxcb.so: (/home/msingh/anaconda3/plugins/platforms/../../lib/libQt5XcbQpa.so.5: symbol _ZN11QFontEngine14bitmapForGlyphEj6QFixedRK10QTransform version Qt_5_PRIVATE_API not defined in file libQt5Gui.so.5 with link time reference)"
qt.qpa.plugin: Could not load the Qt platform plugin "xcb" 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: eglfs, minimal, minimalegl, offscreen, vnc, xcb.
[Done] exited with code=null in 0.66 seconds