Install & Compatibility
Where this runs
tested against v0.3.4 · 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.700s · 28.8MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.2s · import 0.646s · 29MB
25MB installed
● package 25MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
inquirer
✓ from InquirerPy import inquirer
Recommended 'Alternate Syntax' for direct interaction with prompt classes.
prompt
✓ from InquirerPy import prompt
Used for 'Classic Syntax' (PyInquirer compatible), taking a list of questions.
Validator
✓ from InquirerPy.validator import Validator
✗ from InquirerPy import Validator
Validator classes (e.g., NumberValidator, PathValidator) are within the 'validator' submodule.
This quickstart demonstrates the recommended 'Alternate Syntax' to create and execute common interactive prompts like text input, single-choice selection, and confirmation. The `.execute()` method runs the prompt and returns the user's input.
from InquirerPy import inquirer
name = inquirer.text(message="What's your name:").execute()
fav_lang = inquirer.select(
message="What's your favourite programming language:",
choices=["Go", "Python", "Rust", "JavaScript"],
).execute()
confirm = inquirer.confirm(message="Confirm?").execute()
print(f"Hello {name}, your favourite language is {fav_lang}, and you confirmed: {confirm}")
inquirer --version
Debug
Known issues
breakingWhen migrating from PyInquirer, note that 'EditorPrompt' is not supported in InquirerPy. Also, parameters for 'CheckboxPrompt' (e.g., `pointer_sign` changed to `pointer`) and keys for 'Style' (e.g., `selected` changed to `pointer`) have been renamed or altered.fixReview the InquirerPy migration guide for specific parameter and style key changes, and replace unsupported prompts with alternative InquirerPy options.
affects: All versions (migration from PyInquirer)
deprecatedThe `raise_keyboard_interrupt` parameter in the `.execute()` function is slated for deprecation. Its behavior has changed, and the recommended approach is to provide `raise_keyboard_interrupt` as an initialisation option to the prompt class.fixPass `raise_keyboard_interrupt=True/False` directly when initializing the prompt (e.g., `inquirer.text(message='...', raise_keyboard_interrupt=True)`).
affects: >=0.3.0
gotchaIn version 0.3.4, automatic spacing was introduced for checkbox, expand, and rawlist prompts. If you have custom `enabled_symbol` or `disabled_symbol` configurations, you might need to remove any extra spaces you previously added to maintain alignment.fixInspect custom symbol configurations for checkbox, expand, and rawlist prompts and adjust spacing as needed to accommodate the new automatic spacing.
affects: >=0.3.4
deprecatedFor the `expand` prompt, the `help_msg` parameter has been deprecated in favor of `expand_help` for customising help messages and expansion keys.fixReplace `help_msg` with `expand_help` when configuring the `expand` prompt.
affects: >=0.3.0
gotchaThe default value for the `border` parameter in fuzzy prompts was changed from `True` to `False` in version 0.3.4 to ensure consistency with other prompt types.fixIf you require a border for fuzzy prompts, explicitly set `border=True` during prompt initialization.
affects: >=0.3.4
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'InquirerPy'
The InquirerPy library is not installed in the current Python environment, or there is a typo in the import statement. This can also occur when trying to import the older `inquirer` or `PyInquirer` library with the `InquirerPy` package name.
fixInstall the library using `pip install InquirerPy`. If using a virtual environment, ensure it is activated. Verify import statements match `from InquirerPy import inquirer` or `from InquirerPy.prompts.input import InputPrompt`.
InquirerPy.exceptions.RequiredKeyNotFound
When using the `InquirerPy.resolver.prompt` (classic syntax), a question dictionary is missing one of the mandatory keys such as 'type', 'message', or 'name'.
fixEnsure all dictionaries passed in the `questions` list have at least `'type'` and `'message'` keys defined. For result retrieval, include a `'name'` key.
KeyboardInterrupt (Ctrl+C does not exit program or skips unexpectedly)
The `raise_keyboard_interrupt` parameter, when set to `False`, causes `Ctrl+C` to skip the current prompt instead of raising a `KeyboardInterrupt` exception and terminating the program.
fixTo make `Ctrl+C` terminate the program, set `raise_keyboard_interrupt=True` (which is the default in newer versions, but might be explicitly set to `False` by users) in your `inquirer.prompt` or specific prompt method call.
AttributeError: 'InputPrompt' object has no attribute 'some_expected_attribute' or TypeError: 'InputPrompt' object is not subscriptable
When using the alternate syntax (e.g., `inquirer.text(...)`), the `.execute()` method was forgotten, so the code is attempting to operate on the prompt *object* itself rather than the *result* returned by the user.
fixAppend `.execute()` to your prompt call to retrieve the user's input, like `name = inquirer.text(message='What\'s your name:').execute()`.
Upgrade
Version history
0.3.4latest on PyPI · released Jun 27, 2022
Audit
Dependencies
prompt_toolkitrequiredCore dependency for interactive terminal features.
pfzyrequiredRequired for fuzzy string matching in relevant prompts.
boto3optionalOnly required for running specific examples; not a core library dependency.