Ubuntu22.04下pythonOCC运行报错:缺失Qt平台插件wayland
PythonOCC 7.7.0可视化后端Wayland插件问题求助
在Ubuntu 22.04机器的Anaconda虚拟环境(Python3.9)中已成功安装PythonOCC 7.7.0版本。运行测试示例代码时,先出现无可视化后端相关报错,通过conda安装PySide2后,报错变为找不到Qt平台插件"wayland"。尝试安装wxpython、PyQt、qtwayland5并设置环境变量等方法均未解决问题,寻求可行解决方案。
测试代码
from OCC.Display.SimpleGui import init_display from OCC.Core.BRepPrimAPI import BRepPrimAPI_MakeBox display, start_display, add_menu, add_function_to_menu = init_display() my_box = BRepPrimAPI_MakeBox(10., 20., 30.).Shape() display.DisplayShape(my_box, update=True) start_display()
报错信息
qt - pyside2 backend - Qt version .. qt-qpa-plugin: Could not find the Qt platform plugin "wayland" in "" ###### 3D rendering pipe initialisation ##### Display3d class initialization starting ... Aspect_DisplayConnection created. OpenGL_GraphicDriver created. V3d_Viewer created. AIS_InteractiveContext created. V3d View created
已尝试的解决命令
# wxpython sudo apt update sudo apt install libgtk-3-dev sudo pip install wxpython # pyqt conda install pyqt # qtwayland5 sudo apt install qtwayland5 export QT_QPA_PLATFORM=wayland
内容的提问来源于stack exchange,提问作者MrJ
相关产品推荐
相关产品推荐

