{"id":7304,"library":"inquirer3","title":"Inquirer3 Interactive CLI","description":"Inquirer3 is a Python library providing a collection of common interactive command-line user interfaces, closely mirroring the functionality of Inquirer.js. It is a community-driven fork of the original `python-inquirer` project, aiming for more responsive development and maintenance. The library simplifies the process of asking end-user questions, parsing and validating answers, and managing hierarchical prompts in terminal applications. The current version is 0.6.1, and it maintains an active release cadence with regular updates.","status":"active","version":"0.6.1","language":"en","source_language":"en","source_url":"https://github.com/guysalt/python-inquirer3","tags":["cli","interactive","terminal","user-interface","prompt","inquirer.js-port"],"install":[{"cmd":"pip install inquirer3","lang":"bash","label":"Install latest stable version"}],"dependencies":[{"reason":"Required for using the `inquirer3.Editor` question type, which opens an external text editor for user input. This dependency was introduced in `v0.6.0`, replacing `python-editor`.","package":"editor","optional":true}],"imports":[{"symbol":"Text","correct":"from inquirer3 import Text"},{"symbol":"List","correct":"from inquirer3 import List"},{"symbol":"Checkbox","correct":"from inquirer3 import Checkbox"},{"symbol":"prompt","correct":"import inquirer3\nanswers = inquirer3.prompt(questions)"}],"quickstart":{"code":"import inquirer3\nimport re\n\nquestions = [\n    inquirer3.Text('name', message=\"What's your name?\"),\n    inquirer3.Text(\n        'phone',\n        message=\"What's your phone number?\",\n        validate=lambda _, x: re.match(r'\\+?\\d[\\d ]+\\d', x) or 'Invalid phone number'\n    ),\n    inquirer3.List(\n        'size',\n        message='What size do you need?',\n        choices=['Large', 'Medium', 'Small'],\n        default='Medium'\n    )\n]\n\nanswers = inquirer3.prompt(questions)\nprint(f\"Hello {answers['name']}! Your phone is {answers['phone']} and you need a {answers['size']} size.\")","lang":"python","description":"This quickstart demonstrates how to define a series of interactive questions using `inquirer3.Text` and `inquirer3.List` types, including input validation. The `inquirer3.prompt()` function collects user input and returns answers as a dictionary."},"warnings":[{"fix":"Ensure `pip install editor` is run. If upgrading from <0.6.0 and encountering issues with `Editor` questions, verify `python-editor` is uninstalled and `editor` is installed.","message":"In version 0.6.0, the dependency for the `Editor` question type changed from `python-editor` to `editor`. If you use the `Editor` question, you must install the `editor` package (`pip install editor`) and potentially uninstall `python-editor` to avoid conflicts or errors.","severity":"breaking","affected_versions":">=0.6.0"},{"fix":"For Windows users, be aware of potential rendering inconsistencies. Report issues to the GitHub repository to help improve support. Consider using WSL2 for a more consistent UNIX-like environment.","message":"Inquirer3's platform support is primarily for UNIX-based systems (macOS, Linux). While Windows has experimental support, users might encounter unexpected behavior or rendering issues. It's recommended to test thoroughly on Windows if targeting that platform.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Always use `pip install inquirer3` and `import inquirer3` (or `from inquirer3 import ...`). Avoid mixing code examples or dependencies from other `inquirer` forks.","message":"There are multiple Python libraries with 'inquirer' in their name (`python-inquirer`, `PyInquirer`, `inquirerpy`, `inquirer3`). Ensure you are importing from `inquirer3` and installing the `inquirer3` package specifically to avoid compatibility issues or `ModuleNotFoundError` due to different APIs or underlying dependencies.","severity":"gotcha","affected_versions":"All versions"}],"env_vars":null,"last_verified":"2026-04-16T00:00:00.000Z","next_check":"2026-07-15T00:00:00.000Z","problems":[{"fix":"Activate your virtual environment (if using one) and run `pip install inquirer3`. If using an IDE, ensure it's configured to use the correct Python interpreter where `inquirer3` is installed.","cause":"The `inquirer3` library is not installed in the currently active Python environment, or your IDE/script is configured to use a different Python interpreter where it is not installed.","error":"ModuleNotFoundError: No module named 'inquirer3'"},{"fix":"For `inquirer3 >= 0.6.0`, install `pip install editor`. For `inquirer3 < 0.6.0`, install `pip install python-editor`. Also, ensure your system has a text editor (e.g., `vim`, `nano`) or set the `EDITOR` or `VISUAL` environment variables. [cite: 1, v0.6.0 release notes]","cause":"The `Editor` question type relies on an external editor library. For `inquirer3 < 0.6.0`, it required `python-editor`. For `inquirer3 >= 0.6.0`, it requires `editor`. This error indicates the necessary dependency is missing.","error":"ModuleNotFoundError: No module named 'python_editor' (or similar for 'editor')"},{"fix":"Ensure that `inquirer3.prompt` is called with a list of instantiated `inquirer3.Question` objects, like `[inquirer3.Text('name', message='...'), inquirer3.List('choice', choices=['A', 'B'])]`. Do not use dictionary representations for questions.","cause":"This typically occurs when trying to pass a dictionary-based question list (common in `PyInquirer`) to `inquirer3.prompt`, which expects a list of `inquirer3.Question` objects (e.g., `inquirer3.Text`, `inquirer3.List`).","error":"TypeError: prompt() got an unexpected keyword argument 'questions'"}]}