Registry / devops / inquirer

inquirer

JSON →
library3.4.1pypypi✓ verified 23d ago

Inquirer is a Python library that provides a collection of common interactive command-line user interfaces, based on the popular Inquirer.js. It aims to simplify asking questions, parsing and validating answers, and managing hierarchical prompts in CLI applications. The library is actively maintained and receives regular updates, with the current version being 3.4.1.

pip install inquirer
INSTALL
IMPORT
SIG · INQUIRER
I
inquirer
devopspythonv3.4.1
Install
2.2s avg
Import
686ms
Disk
23MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.4.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.95 runs
installs and imports cleanly · install 0.0s · import 0.722s · 27MB
glibc
py 3.103.95 runs
installs and imports cleanly · install 2.2s · import 0.650s · 27MB
23MB installed
● package 23MB
Code
Verified usage

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

inquirer
import inquirer
The main entry point for creating and prompting questions.
inquirer.prompt
import inquirer answers = inquirer.prompt(questions)
The function used to display prompts and collect answers.
Question Types
import inquirer inquirer.Text(...) inquirer.List(...) inquirer.Confirm(...) inquirer.Checkbox(...) inquirer.Editor(...) inquirer.Path(...) inquirer.Password(...)
from PyInquirer import prompt
This registry entry refers to the `inquirer` library (magmax/python-inquirer). While inspired by Inquirer.js, `PyInquirer` was a different, less maintained project, and `InquirerPy` is another re-implementation. Ensure you are importing from `inquirer`.

This quickstart demonstrates how to create a list of different question types (Text, List, Confirm) and use `inquirer.prompt` to display them to the user, collecting the answers in a dictionary.

import inquirer questions = [ inquirer.Text('name', message="What's your name?"), inquirer.List( 'size', message="What size do you need?", choices=['Jumbo', 'Large', 'Standard', 'Medium', 'Small', 'Micro'], ), inquirer.Confirm('confirm', message="Proceed?") ] answers = inquirer.prompt(questions) print(f"Hello, {answers['name']}! You selected {answers['size']} and confirmed: {answers['confirm']}")
inquirer --version
Debug
Known issues
breakingPython 3.8 is no longer supported. Users on Python 3.8 will need to upgrade their Python version to 3.9.2 or higher, or stick to an older `inquirer` version (<=3.4.0).
fix
Upgrade Python to 3.9.2 or newer, or downgrade `inquirer` to 3.4.0 or earlier.
affects: >=3.4.1
breakingThe `normalize_to_absolute_path` argument has been removed from the `inquirer.Path` question type.
fix
Review code using `inquirer.Path` and remove the `normalize_to_absolute_path` argument. Adjust path handling logic if absolute paths were previously relied upon through this argument.
affects: >=3.3.0
gotchaValidation functions for questions must accept two arguments: `(answers, current)`, where `answers` is a dictionary of previously collected responses and `current` is the input for the current question. Providing only one argument (e.g., `lambda current: ...`) will cause validation to always fail, as exceptions are caught and treated as validation errors.
fix
Ensure your validation lambda or function has the signature `def validate_func(answers, current):` even if `answers` is not used. Return `True` for success, or raise `inquirer.errors.ValidationError('', reason='Your custom message')` for a custom error.
affects: All versions
gotchaUsers often encounter `ModuleNotFoundError` when installing `inquirer` in a virtual environment. This is typically due to the virtual environment not being correctly activated or `pip install` being run outside the activated environment.
fix
Ensure your virtual environment is activated before running `pip install inquirer`. Verify that the Python interpreter being used is the one from the virtual environment.
affects: All versions
gotchaAvoid using Python's built-in keywords or common types as variable names for your question IDs (e.g., `list`, `dict`). This can shadow the built-in type and lead to unexpected behavior or difficult-to-debug errors.
fix
Use descriptive variable names for question IDs that do not conflict with Python's built-in keywords or types. For example, instead of `list = [...]`, use `my_list_of_questions = [...]`.
affects: All versions
gotchaWhile Windows support has seen improvements (e.g., Unicode handling in v3.4.0), it is still considered experimental. Users may encounter platform-specific issues compared to UNIX-based systems.
fix
Report any Windows-specific issues encountered on the GitHub repository. Consider testing your CLI application on a UNIX-like environment if consistent behavior is critical across platforms.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'inquirer'
The 'inquirer' library is not installed in the current Python environment or the Python interpreter being used does not have access to the installed library.
fix
Install the library using pip: `pip install inquirer`
AttributeError: module 'inquirer' has no attribute 'List'
This error typically occurs when trying to access a question type (like 'List', 'Checkbox', 'Text', etc.) directly as an attribute of the top-level 'inquirer' module, or if an older version of 'inquirer' is being used where these question types might have been structured differently. For version 3.4.1, question types are classes within the `inquirer` module and should be instantiated correctly.
fix
Ensure you are instantiating question objects from the `inquirer` module correctly. For example, to create a list question, use `inquirer.List(...)` after importing `inquirer`:
```python
import inquirer
questions = [
    inquirer.List('size',
                   message='What size do you need?',
                   choices=['Jumbo', 'Large', 'Standard', 'Medium', 'Small', 'Micro'],
                  ),
]
answers = inquirer.prompt(questions)
```
Inquirer prompt not interactive / not working in PyCharm
Interactive command-line interfaces like Inquirer rely on terminal emulation features that are often not enabled by default in IDEs like PyCharm. The output console might not support the special terminal functionalities required for interactive prompts.
fix
In PyCharm, enable 'Emulate terminal in output console' in your Run/Debug Configuration. Alternatively, run your Python script directly from a system terminal (e.g., cmd, PowerShell, Bash) outside of the IDE.
AttributeError: 'list' object has no attribute 'items'
This error occurs when attempting to call the `.items()` method on a Python list object. The `inquirer.prompt()` function returns a dictionary, but if the subsequent code incorrectly assumes a list (or tries to call `.items()` on a list that might be a value within the dictionary result), this error will be raised. The `.items()` method is exclusive to dictionary objects for iterating over key-value pairs.
fix
Ensure that the variable you are calling `.items()` on is indeed a dictionary. If `inquirer.prompt()` has returned its expected dictionary, you can iterate over it directly. If you have a list of dictionaries, iterate through the list first and then call `.items()` on each dictionary within the loop.
```python
import inquirer

questions = [
    inquirer.Text('name', message="What's your name"),
]

answers = inquirer.prompt(questions)

# Correct usage: answers is a dictionary
if answers:
    for key, value in answers.items():
        print(f"{key}: {value}")

# Incorrect usage (would cause the error if 'my_list_var' was a list):
# for key, value in my_list_var.items():
#    print(f"{key}: {value}")
```
Upgrade
Version history
3.4.1latest on PyPI · released Aug 2, 2025
Audit
Dependencies
pythonrequiredRequires Python 3.9.2 or higher.
readcharrequiredImproved Unicode support on Windows, especially from v3.4.0 onwards.
Agent activity
19 hits · last 30 days
node
16
Resources
inquirer — pip install inquirer · libregistry