Registry / readline

readline

JSON →
library6.2.4.2pypiunverified

The `readline` PyPI package (version 6.2.4.2) is a third-party distribution that aims to provide the functionality of the standard Python `readline` module, statically linked against the GNU readline library. It was primarily created for environments where the built-in `readline` module (part of the Python standard library) was unavailable or broken, particularly on older Python versions. It explicitly requires Python < 3.4 and is considered abandoned for modern Python versions. The standard `readline` module is built into CPython on Unix-like systems and typically does not require `pip install`.

pip install readline
INSTALL
IMPORT
SIG · READLINE
R
readline
env6.2.4.2
Install
—
Import
—
Disk
—
Pass rate
0/ 10
Env Coverage0 / 10
glibc
3.9–3.13
musl
3.9–3.13
Install & Compatibility
Where this runs
tested against v? · pip install
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.10–3.910 runs
build_error
glibc
py 3.10–3.910 runs
build_error
Code
Verified usage

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

readline
✓ import readline

This quickstart demonstrates basic tab completion and history management using the `readline` module's API. Note that the PyPI package `readline` provides this API, but is only compatible with Python < 3.4.

import readline import os # Example completer function def completer(text, state): options = ['hello', 'world', 'exit', 'help'] matching_options = [cmd for cmd in options if cmd.startswith(text)] if state < len(matching_options): return matching_options[state] else: return None # Enable tab completion readline.set_completer(completer) readline.parse_and_bind('tab: complete') # Optional: Load/Save history histfile = os.path.join(os.path.expanduser('~'), '.python_history') try: readline.read_history_file(histfile) readline.set_history_length(1000) except FileNotFoundError: pass # History file may not exist yet except Exception as e: print(f"Warning: Could not read history file: {e}") print("Type 'hello', 'world', 'exit', or 'help'. Press TAB for completion.") while True: try: line = input(">>> ") if line == "exit": break print(f"You typed: {line}") except EOFError: print("\nEOF encountered. Exiting.") break except KeyboardInterrupt: print("\nKeyboardInterrupt. Exiting.") break finally: try: # Ensure history is written if modifications were made readline.write_history_file(histfile) except Exception as e: print(f"Warning: Could not write history file: {e}")
Debug
Known issues
breakingThis PyPI package ('readline' version 6.2.4.2) is incompatible with Python 3.4 and newer versions, explicitly requiring Python < 3.4. Attempting to install or use it on modern Python will fail.
fix
For Python 3.4+ on Unix-like systems, the standard `readline` module is built into CPython and does not require `pip install`. If you are on Windows, the built-in `readline` is unavailable; consider alternatives like `pyreadline3` or `prompt_toolkit`.
affects: Python 3.4 and later
gotchaDo not confuse this specific PyPI package (`readline`) with the standard library `readline` module. The standard module is an intrinsic part of CPython on Unix-like systems and typically does not need `pip install`. This PyPI package was a third-party attempt to provide that functionality for older Python versions or specific environments.
fix
Always check your Python version. If on Python 3.4+, rely on the standard library module (if on Unix) or an appropriate alternative (if on Windows/missing specific features). This PyPI package is not maintained for modern Python.
affects: All Python versions
gotchaInstallation of this `readline` PyPI package (even on Python < 3.4) can fail due to missing system-level GNU readline development libraries (e.g., `libreadline-dev` or `readline-devel`).
fix
Ensure you have the necessary system development headers and libraries for GNU readline installed before attempting `pip install readline`. For example, on Debian/Ubuntu: `sudo apt-get install libreadline-dev`. On Fedora/RHEL: `sudo dnf install readline-devel`.
affects: All supported Python versions (<3.4)
Errors
Common errors & fixes
ERROR: Package 'readline' requires a different Python. Python 3.X.Y is not among the supported versions (<3.4)
Attempting to install the `readline` PyPI package on Python 3.4 or newer.
fix
This package is for Python < 3.4. For modern Python (3.4+), use the built-in `readline` module (on Unix-like systems) or alternatives like `pyreadline3` / `prompt_toolkit`.
ImportError: No module named 'readline'
The `readline` module is not found. This can happen on Windows (where it's not built-in), if the system Python was compiled without readline support, or if the old PyPI package wasn't correctly installed for Python < 3.4.
fix
On Unix-like systems with Python 3.4+, ensure your Python installation includes readline support (it usually does). If on Windows, the built-in `readline` module is not available; consider `pyreadline3`. For Python < 3.4, ensure `pip install readline` was successful and system dependencies were met.
ImportError: libreadline.so.6: cannot open shared object file: No such file or directory
The shared library for GNU readline (a system dependency) is missing or not found in the system's library paths. This is a common issue when installing C extensions that depend on system libraries.
fix
Install the system-level GNU readline development libraries. For Debian/Ubuntu: `sudo apt-get install libreadline-dev`. For Fedora/RHEL: `sudo dnf install readline-devel`. Ensure your `LD_LIBRARY_PATH` (Linux) or `DYLD_LIBRARY_PATH` (macOS) is correctly configured if libraries are in non-standard locations.
Upgrade
Version history
6.2.4.2latest on PyPI · released Oct 12, 2022
Audit
Dependencies

No dependency data recorded yet.

Agent activity
4 hits · last 30 days
node
4
Resources

No resource links recorded.

readline — pip install readline · libregistry