Registry / web-framework / PySimpleGUI

PySimpleGUI

JSON →
library6.0pypypi✓ verified 51d ago

PySimpleGUI is a Python package that enables creating simple, cross-platform GUIs with ease. It wraps tkinter, Qt, WxPython, and Remi (web) into a unified API. Current version is 6.0, released in 2026 under LGPL3. New major version with significant API changes and improved theming.

web-framework
pip install PySimpleGUI
Install & Compatibility
Where this runs
tested against v6.2 · pip install
no network on importno background threads
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.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 20.7MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 1.7s · import 0.000s · 21MB
19MB installed
● package 19MB
Code
Verified usage

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

PySimpleGUI
import PySimpleGUI as sg
from PySimpleGUI import *
Common mistake: wildcard imports can pollute namespace and hide errors. Always use 'import PySimpleGUI as sg'.
sg.Window
import PySimpleGUI as sg; sg.Window(...)
from PySimpleGUI import Window; Window(...)
Recommended pattern is to use sg prefix; direct imports may cause confusion with other libraries.

Creates a simple window with a text and a button. Uses the standard event loop pattern.

import PySimpleGUI as sg layout = [[sg.Text('Hello from PySimpleGUI')], [sg.Button('OK')]] window = sg.Window('Demo', layout) while True: event, values = window.read() if event == sg.WIN_CLOSED or event == 'OK': break window.close()
Debug
Known issues
breakingVersion 6.0 introduced a completely new theming system and deprecated many old theme names. If upgrading from 5.x, existing themes may break.
fix
Update theme calls to new API: use sg.theme('DarkBlue3') instead of sg.SetOptions(background_color='...'). Check release notes for full list of changes.
affects: 5.x -> 6.0
breakingThe 'Button' element is now 'Button' (capital B) instead of 'Button' in older versions? Actually, it's always been Button. But in 6.0, the 'OK' button no longer auto-closes the window; you must handle the event explicitly.
fix
In event loop, explicitly break when event is 'OK' or sg.WIN_CLOSED.
affects: 6.0
gotchaCalling window.close() outside the event loop or forgetting to close the window can cause memory leaks or hanging processes.
fix
Always call window.close() after the event loop ends. Use try/finally or context manager if available (not in standard API).
affects: all
Errors
Common errors & fixes
AttributeError: module 'PySimpleGUI' has no attribute 'Window'
Typo or incorrect import. Common mistake: installing 'pysimplegui' (lowercase) instead of 'PySimpleGUI' (capital letters).
fix
Ensure you installed PySimpleGUI with correct casing: pip install PySimpleGUI (case-sensitive on some systems). Then use import PySimpleGUI as sg.
NameError: name 'sg' is not defined
Forgot to import or used wrong import alias.
fix
Add 'import PySimpleGUI as sg' at the top of your script.
Upgrade
Version history
6.2latest on PyPI
Audit
Dependencies

No dependency data recorded yet.

Agent activity
92 hits · last 30 days
node
24
ahrefsbot
2
amazonbot
1
bytedance
1
Resources