Install & Compatibility
Where this runs
tested against v0.98.3 · 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
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 18.2MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
16MB installed
● package 16MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
easygui
✓ import easygui as eg
Using an alias (e.g., `eg`) is recommended to keep the namespace clean and minimize typing. `import easygui` is also correct but requires `easygui.func()` calls.
*
✓
✗ from easygui import *
While functional, 'import *' is generally considered bad Python practice as it pollutes the global namespace with all EasyGUI functions, potentially leading to name clashes.
This quickstart demonstrates basic EasyGUI interactions: displaying a message box, asking a yes/no question, and getting text input from the user. EasyGUI functions are blocking, meaning the program waits for user interaction before proceeding. Remember to run EasyGUI scripts outside of IDLE for best compatibility.
import easygui as eg
import sys
# Display a simple message box
eg.msgbox("Hello from EasyGUI!", "Welcome")
# Ask a yes/no question
if eg.ynbox("Shall I continue?", "Question"):
# If user chose Yes, ask for input
name = eg.enterbox("What is your name?", "Name Input")
if name:
eg.msgbox(f"Hello, {name}!", "Greeting")
else:
eg.msgbox("You cancelled the name input.", "Cancelled")
else:
eg.msgbox("You chose to exit.", "Exit")
sys.exit(0)
Debug
Known issues
gotchaEasyGUI programs often conflict with the IDLE IDE (Python's default editor) because both EasyGUI (via Tkinter) and IDLE use their own event loops, leading to unpredictable behavior or freezing.fixAlways run EasyGUI scripts directly from a terminal or another IDE (e.g., VS Code, PyCharm) rather than from IDLE.
affects: All versions
breakingEasyGUI 0.98.0 introduced a syntax error (`except Exception, e:`) that was incompatible with Python 3.5+ due to changes in exception handling syntax.fixUpgrade to EasyGUI 0.98.1 or any later version (e.g., `pip install --upgrade easygui`). This issue was resolved in 0.98.1.
affects: 0.98.0 when used with Python 3.5 or newer
gotchaEasyGUI is NOT event-driven. Its functions are blocking calls; the program execution pauses until the user interacts with and closes the displayed dialog box. This is fundamentally different from traditional GUI frameworks.fixDesign your application flow around sequential, blocking user interactions. If you require complex, responsive, or multi-threaded GUIs, consider a full-fledged event-driven framework like Tkinter, PyQt, or Kivy.
affects: All versions
gotchaThe `multenterbox()` function (and similar input boxes) returns user input as a list of strings, even for single fields or intended numeric inputs. Attempting to perform arithmetic directly on these string elements will result in `TypeError`.fixAlways extract values from the returned list and explicitly convert them to the appropriate data type (e.g., `int()`, `float()`) before performing numeric operations. For example: `value = int(multenterbox(...)[0])`.
affects: All versions
gotchaWhen displaying images in functions like `buttonbox()`, EasyGUI only natively supports GIF (.gif) file format.fixEnsure that any image files you intend to display with EasyGUI functions are in the GIF format. Convert other formats if necessary.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'easygui'
The easygui library is not installed in your current Python environment or the Python interpreter cannot find it.
fixInstall easygui using pip: `pip install easygui` (or `py -m pip install easygui` on Windows if you have multiple Python versions).
AttributeError: module 'easygui' has no attribute 'msgbox'
Your Python script file is likely named `easygui.py`, causing Python to import your local script instead of the installed easygui library. Alternatively, you might be using a very old version of easygui where the function did not exist.
fixRename your Python script file to something other than `easygui.py` (e.g., `my_app.py`). If the issue persists, ensure easygui is up-to-date: `pip install --upgrade easygui`.
SyntaxError: invalid syntax (related to 'except Exception, e:')
This specific syntax error typically occurs when an older version of easygui, written with Python 2's exception handling syntax (`except Exception, e:`), is run with Python 3, which requires `except Exception as e:`.
fixUpgrade easygui to the latest version, as newer versions are compatible with Python 3 syntax: `pip install --upgrade easygui`.
ModuleNotFoundError: No module named 'global_state'
This error often indicates an issue with the underlying Tkinter installation, which easygui depends on, or a problem with the easygui installation where internal modules are not correctly resolved, especially in certain IDEs like PyCharm.
fixEnsure Tkinter is correctly installed for your Python version (e.g., `sudo apt-get install python3-tk` on Linux or verify a full Python installation on Windows/macOS). Then, try reinstalling easygui: `pip uninstall easygui && pip install easygui`.
Upgrade
Version history
0.98.3latest on PyPI · released Apr 1, 2022
Audit
Dependencies
TkinterrequiredEasyGUI is built on Tkinter. On Linux, Tkinter (python-tk or python3-tk) may need to be installed separately via the system package manager.