wxWidgets / Phoenix

wxPython's Project Phoenix. A new implementation of wxPython, better, stronger, faster than he was before.
http://wxpython.org/
2.21k stars 509 forks source link

SystemError: <slot wrapper '__init__' of 'sip.simplewrapper' objects> returned a result with an error set #2545

Open Auditor1234 opened 1 month ago

Auditor1234 commented 1 month ago

Operating system: ubuntu22.04.01 wxPython version & source: 4.2.1 Python version & source: 3.8.19

Description of the problem: When I use 'glcanvas' to initialize a instance like this glcanvas.GLCanvas.__init__(self, parent, -1, attribList=attribList), then my program raise the exception.

Code Example (click to expand) ```python # Put code sample here class Canvas3D(glcanvas.GLCanvas): def __init__(self, parent, manager=None): attribList = attribs = (glcanvas.WX_GL_CORE_PROFILE, glcanvas.WX_GL_RGBA, glcanvas.WX_GL_DOUBLEBUFFER, glcanvas.WX_GL_DEPTH_SIZE, 24) glcanvas.GLCanvas.__init__(self, parent, -1, attribList=attribList) self.init = False ``` on above ``` parent is , an object inhereit from class `wx.Panel` attribList=(21, 0, 3, 10, 24) ```
swt2c commented 1 month ago

Please provide both:

  1. The full stacktrace.
  2. A simple, complete, runnable example that reproduces the problem.
Auditor1234 commented 1 month ago

Thank you for your reply, cuase this problem occurs when I use other guy's complicate project and I am not familiar with wxPython , I am unable to simplify it and provide a simple example.

While the full stacktrace is as following:

/data/lzr/NormalSoftware/Anaconda3/envs/mamba/lib/python3.8/site-packages/wx/lib/pubsub/__init__.py:23: wxPyDeprecationWarning: wx.lib.pubsub has been deprecated, please migrate your code to use pypubsub, available on PyPI.
  warnings.warn('wx.lib.pubsub has been deprecated, please migrate your '
NotImplementedError

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/data/lzr/ProgramFiles/python/Temp/Show3D.py", line 31, in <module>
    manager.show('Organ 3D Demo')
  File "/data/lzr/ProgramFiles/python/Temp/myvi/manager.py", line 282, in show
    Frame3D(None, title, self).Show()
  File "/data/lzr/ProgramFiles/python/Temp/myvi/frame3d.py", line 17, in __init__
    self.viewer = canvas3d.Viewer3D( self , manager)
  File "/data/lzr/ProgramFiles/python/Temp/myvi/canvas3d.py", line 132, in __init__
    self.canvas = Canvas3D(self, manager)
  File "/data/lzr/ProgramFiles/python/Temp/myvi/canvas3d.py", line 14, in __init__
    glcanvas.GLCanvas.__init__(self, parent, -1, attribList=attribList)
SystemError: <slot wrapper '__init__' of 'sip.simplewrapper' objects> returned a result with an error set