DPGui
raw JSON → 1.0.1 verified Fri May 01 auth: no python
A web-based GUI for user inputs, built on top of Dear PyGui. Version 1.0.1, maintenance mode with infrequent releases.
pip install dpgui Common errors
error ModuleNotFoundError: No module named 'dearpygui' ↓
cause dpgui depends on dearpygui but does not install it automatically.
fix
Run
pip install dearpygui. error TypeError: start() got an unexpected keyword argument 'port' ↓
cause The 'port' argument was removed in v1.0.0; set via environment variable instead.
fix
Use
os.environ['DPGUI_PORT'] = '8080' before calling dp.start(). error ValueError: Unknown field key: 'id' ↓
cause The field definition key 'id' was renamed to 'name' in v1.0.0.
fix
Change 'id' to 'name' in the field dictionary.
Warnings
breaking dpgui 1.0.0 changed the API: the `start` function no longer accepts a `port` argument; use environment variable `DPGUI_PORT` or modify source. ↓
fix Set the port via `os.environ['DPGUI_PORT'] = '8080'` before calling `start()`.
deprecated The `fields` parameter in `start()` expects 'name', 'type', 'label' keys; using 'id' instead of 'name' is deprecated and will be removed in 2.0. ↓
fix Use 'name' as the key for field identifiers.
gotcha dpgui requires Dear PyGui to be installed. If you install dpgui without dearpygui, it will fail at runtime. ↓
fix Install dearpygui via `pip install dearpygui`.
gotcha The web GUI runs on localhost only by default. To expose it to other machines, you must set `DPGUI_HOST` environment variable to '0.0.0.0'. ↓
fix Set `os.environ['DPGUI_HOST'] = '0.0.0.0'` before running `start()`.
Imports
- dp wrong
from dpgui import *correctimport dpgui as dp - start wrong
from dpgui.start import startcorrectimport dpgui as dp; dp.start()
Quickstart
import dpgui as dp
def callback(values):
print('User input:', values)
dp.start(callback=callback, title='My App', fields=[{'name': 'name', 'type': 'text', 'label': 'Your Name'}])