Open hongyuan1306 opened 1 year ago
I find that in order to avoid the above segmentation fault, one has to call load_backend
before importing init_display
:
(cnc) hong@hong-office:~/workspace/cnc$ python
Python 3.10.11 | packaged by conda-forge | (main, May 10 2023, 18:58:44) [GCC 11.3.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> from OCC.Display.backend import load_backend
>>> load_backend()
'qt-pyside2'
>>> from OCC.Display.SimpleGui import init_display
>>> init_display()
qt-pyside2 backend - Qt version 5.15.8
####### 3D rendering pipe initialisation #####
Display3d class initialization starting ...
Aspect_DisplayConnection created.
OpenGl_GraphicDriver created.
V3d_Viewer created.
AIS_InteractiveContext created.
V3d_View created
Xw_Window created.
TKOpenGl | Type: Other | ID: 0 | Severity: Medium | Message:
OpenGl_Window::CreateWindow: window Visual is incomplete: no stencil buffer
Display3d class successfully initialized.
#########################################
...
With the latest pythonocc-core version 7.7.0 and pyside2, init_display() is throwing a
Segmentation fault
.The error can be reproduced by running the following on Ubuntu 23.04:
and running python:
Running the above procedure on Win11 is OK. And also if I install
pyqt5
(using pip) instead ofpyside2
, there is also no problem.