Segmentation fault when quit wx 4.2.1 in ubuntu 24.04

:~$ python3
Python 3.12.3 (main, Jul 31 2024, 17:43:48) [GCC 13.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import wx

Segmentation fault (core dumped)

~$ python3
Python 3.12.3 (main, Jul 31 2024, 17:43:48) [GCC 13.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

:~$ python3
Python 3.12.3 (main, Jul 31 2024, 17:43:48) [GCC 13.2.0] on linux
Type “help”, “copyright”, “credits” or “license” for more information.

import serial

In each case ctrl-D was used to quit python
python3 scripts that import wx always have seg fault when exit with ctrl-C or sys.exit()

pyserial recently installed
wxPython 4.2.1: successful build yesterday
ubuntu 24.04: newly installed

Yes, this is a known bug which has been fixed but not released.

As a workaround, if you’re able to, you can use the distribution packages in Ubuntu 24.04, which shouldn’t have this problem: apt install python3-wxgtk4.0

Please note that if you do install the python3-wxgtk4.0 package and also need wx.html2 (for WebView) and/or wx.media (for MediaCtrl), you will also need to install the python3-wxgtk-webview4.0 and/or the python3-wxgtk-media4.0 packages.

1 Like

I tried the above but I got the below

sudo apt install python3-wxpython4.0

Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
E: Unable to locate package python3-wxpython4.0
E: Couldn't find any package by glob 'python3-wxpython4.0'

Try:

sudo apt install python3-wxgtk4.0

Thank you for correcting my oops @RichardT :slight_smile: