Registry / web-framework / dearpygui

dearpygui

JSON →
library2.3.1pypypi✓ verified 86d ago

Dear PyGui is a simple, fast, and powerful Python GUI toolkit that provides a wrapper for the Dear ImGui library. It allows for the rapid creation of highly interactive graphical user interfaces with Python, often used for tools, dashboards, and visualizations. The current version is 2.3, and it maintains an active release cadence with significant updates, including major version bumps for internal dependency upgrades and API changes.

pip install dearpygui
INSTALL
IMPORT
SIG · DEARPYGUI
D
dearpygui
web-frameworkpythonv2.3.1
Install
1.8s avg
Import
Disk
27MB
Pass rate
5/ 10
Env Coverage5 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v2.3.1 · 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.910 runs
build_error
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.8s · import 0.000s · 29MB
27MB installed
● package 27MB
Code
Verified usage

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

dpg
import dearpygui.dearpygui as dpg

This quickstart creates a simple DearPyGui application with a window containing text and a button. It demonstrates the basic lifecycle: context creation, viewport setup, running the main loop, and context destruction.

import dearpygui.dearpygui as dpg dpg.create_context() dpg.create_viewport(title='My DPG App', width=800, height=600) dpg.setup_dearpygui() with dpg.window(label="Example Window", width=200, height=200): dpg.add_text("Hello, DearPyGui!") dpg.add_button(label="Click Me", callback=lambda: print("Button Clicked!")) dpg.show_viewport() dpg.start_dearpygui() dpg.destroy_context()
Debug
Known issues
breakingVersion 2.0.0 introduced breaking changes due to internal updates to Dear ImGui and ImPlot. Many function parameters, especially related to styling and item configurations (e.g., `add_text`'s `color` argument directly in the function call), were modified or moved to theme systems.
fix
Review the official DearPyGui v2.0.0 changelog and updated documentation. Most style parameters are now handled via `dpg.bind_item_theme()` or through global theme settings rather than direct function arguments.
affects: 2.0.0+
gotchaDear PyGui is *not entirely thread-safe*. While some improvements have been made, shared resources like `dpg.last_item()` or the container stack are still not synchronized across threads, which can lead to deadlocks, segfaults, or race conditions.
fix
Avoid accessing or modifying DearPyGui items from multiple threads simultaneously. Perform all GUI-related operations exclusively on the main thread, or implement custom synchronization mechanisms for any cross-thread communication.
affects: 2.2.0+
gotchaWhen using a custom rendering loop (e.g., `render_dearpygui_frame` instead of `start_dearpygui`) on Windows, the rendering frame can block during viewport resizing or movement. This can impact responsiveness, especially with `asyncio` in the main thread.
fix
Be aware of this blocking behavior. If responsiveness during resize is critical, consider alternative ways to manage your main loop or structure your application to account for these pauses. For most simple applications, `start_dearpygui()` handles this implicitly.
affects: 2.1.0+
Errors
Common errors & fixes
NameError: name 'dpg' is not defined
The `dearpygui.dearpygui` module was imported, but the common alias `dpg` was not used or another alias was used inconsistently.
fix
Ensure you are consistently importing with `import dearpygui.dearpygui as dpg` and referring to functions with `dpg.function_name()`.
RuntimeError: Item with tag '...' already exists.
You are attempting to add an item with a tag that is already in use. All items in DearPyGui must have unique tags.
fix
Either ensure each item has a unique tag (recommended), or check if an item with the desired tag already exists using `dpg.does_item_exist('tag')` before adding it. If you wish to dynamically update an item, use `dpg.set_item_config('tag', **kwargs)` instead of re-adding it.
RuntimeError: Dear PyGui context was not created. Please create a context with `dpg.create_context()`
All DearPyGui operations must occur within an active context, which needs to be explicitly created at the start of your application.
fix
Add `dpg.create_context()` at the very beginning of your DearPyGui application logic, before any other `dpg` calls.
Upgrade
Version history
2.3.1latest on PyPI · released May 1, 2026
Audit
Dependencies

No dependency data recorded yet.

Agent activity
35 hits · last 30 days
node
34
Amazon
1
Resources
dearpygui — pip install dearpygui · libregistry