{"id":9650,"library":"dearpygui","title":"DearPyGui","description":"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.","status":"active","version":"2.3","language":"en","source_language":"en","source_url":"https://github.com/hoffstadt/DearPyGui","tags":["gui","desktop","imgui","toolkit","visualization"],"install":[{"cmd":"pip install dearpygui","lang":"bash","label":"Install latest version"}],"dependencies":[],"imports":[{"symbol":"dpg","correct":"import dearpygui.dearpygui as dpg"}],"quickstart":{"code":"import dearpygui.dearpygui as dpg\n\ndpg.create_context()\ndpg.create_viewport(title='My DPG App', width=800, height=600)\ndpg.setup_dearpygui()\n\nwith dpg.window(label=\"Example Window\", width=200, height=200):\n    dpg.add_text(\"Hello, DearPyGui!\")\n    dpg.add_button(label=\"Click Me\", callback=lambda: print(\"Button Clicked!\"))\n\ndpg.show_viewport()\ndpg.start_dearpygui()\ndpg.destroy_context()","lang":"python","description":"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."},"warnings":[{"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.","message":"Version 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.","severity":"breaking","affected_versions":"2.0.0+"},{"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.","message":"Dear 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.","severity":"gotcha","affected_versions":"2.2.0+"},{"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.","message":"When 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.","severity":"gotcha","affected_versions":"2.1.0+"}],"env_vars":null,"last_verified":"2026-04-17T00:00:00.000Z","next_check":"2026-07-16T00:00:00.000Z","problems":[{"fix":"Ensure you are consistently importing with `import dearpygui.dearpygui as dpg` and referring to functions with `dpg.function_name()`.","cause":"The `dearpygui.dearpygui` module was imported, but the common alias `dpg` was not used or another alias was used inconsistently.","error":"NameError: name 'dpg' is not defined"},{"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.","cause":"You are attempting to add an item with a tag that is already in use. All items in DearPyGui must have unique tags.","error":"RuntimeError: Item with tag '...' already exists."},{"fix":"Add `dpg.create_context()` at the very beginning of your DearPyGui application logic, before any other `dpg` calls.","cause":"All DearPyGui operations must occur within an active context, which needs to be explicitly created at the start of your application.","error":"RuntimeError: Dear PyGui context was not created. Please create a context with `dpg.create_context()`"}]}