Registry / web-framework / wxpython

wxpython

JSON →
library4.2.5pypypiunverified

wxPython is a cross-platform GUI toolkit for Python, providing a native look and feel on Windows, macOS, and Linux by wrapping the wxWidgets C++ library. The current version (4.x, "Phoenix") is a re-implementation focused on improved speed, maintainability, and extensibility. It is actively maintained with regular releases.

pip install wxPython
INSTALL
IMPORT
SIG · WXPYTHON
W
wxpython
web-frameworkpythonv4.2.5
Install
Import
Disk
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v? · pip install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
build_error
glibc
py 3.103.920 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

wx
import wx

This quickstart creates a basic wxPython application with a main window, a static text label, and a button. Clicking the button displays a message box. The `wx.App(False)` initialization prevents stdout/stderr redirection, and `app.MainLoop()` starts the event processing.

import wx class MyFrame(wx.Frame): def __init__(self, parent, title): super(MyFrame, self).__init__(parent, title=title, size=(300, 200)) panel = wx.Panel(self) text = wx.StaticText(panel, label="Hello, wxPython!", pos=(80, 50)) button = wx.Button(panel, label="Click Me", pos=(80, 100)) button.Bind(wx.EVT_BUTTON, self.on_click) self.Show() def on_click(self, event): wx.MessageBox("Button clicked!", "Info", wx.OK | wx.ICON_INFORMATION) if __name__ == '__main__': app = wx.App(False) # False to not redirect stdout/stderr frame = MyFrame(None, "Simple wxPython App") app.MainLoop()
Debug
Known issues
breakingCode written for older "Classic" wxPython (pre-4.0) is not fully compatible with wxPython 4.x (Phoenix) due to significant internal re-implementation and API cleanups. Many `wx.lib` modules changed or were removed, and string handling became exclusively Unicode.
fix
Consult the "Phoenix Migration Guide" in the official documentation to adapt existing code.
affects: <4.0 to 4.x
gotchaDirectly manipulating GUI elements or making wxPython calls from a worker/background thread can lead to application crashes, freezes, or unpredictable behavior. All GUI-related operations must occur on the main thread.
fix
Use `wx.CallAfter()`, `wx.CallLater()`, or `wx.PostEvent()` to safely marshal updates from worker threads to the GUI thread.
affects: All versions
gotchaPerforming long-running computations directly within an event handler on the main GUI thread will block the `MainLoop()`, making the application unresponsive ("frozen").
fix
Offload time-consuming tasks to separate threads or processes. Use thread-safe methods (`wx.CallAfter`, `wx.PostEvent`) to communicate results back to the GUI thread. Consider `wxasync` for `asyncio` integration for cooperative multitasking.
affects: All versions
deprecatedIn wxPython 4.x, the `wx.lib.pubsub` module is deprecated.
fix
Use `import pubsub` directly and adapt import paths (e.g., change `from wx.lib.pubsub import pubsub` to `import pubsub`).
affects: 4.0+
Upgrade
Version history
4.2.5latest on PyPI · released Feb 8, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
49 hits · last 30 days
node
44
OpenAI (training)
1
Resources
wxpython — pip install wxpython · libregistry