Failed to create wl_display (No such file or directory)
qt.qpa.plugin: Could not load the Qt platform plugin "wayland" 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, linuxfb, minimal, minimalegl, offscreen, vnc, wayland-egl, wayland, wayland-xcomposite-egl, wayland-xcomposite-glx, webgl, xcb.
from os import environ, system
...
if system().lower() == 'linux':
if environ["XDG_SESSION_TYPE"].lower() != 'x11':
environ["QT_QPA_PLATFORM"] = "wayland"
...
一般要素
问题描述
在使用xorg时因为在MCSL2.py中QT_QPA_PLATFORM环境变量被设为“wayland”而导致启动时报错
复现
使用xorg为显示服务器的Linux运行MCSL2.py
可能的解决方案(?)
加入显示服务器的判断后更改QT_QPA_PLATFORM环境变量 如将MCSL2.py的第1486行到1487行改为: