Install & Compatibility
Where this runs
tested against v3.5.6 · 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.6MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 1.6s · import 0.000s · 19MB
17MB installed
● package 17MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
readline
✓ import readline
On Windows, pyreadline3 typically patches the built-in 'readline' module, making it available as if it were the standard Unix 'readline' library.
Readline
✓ from pyreadline3 import Readline
Directly import the Readline class for explicit control or when the implicit patching of the 'readline' module is not desired or working as expected.
This quickstart demonstrates how pyreadline3 makes the `readline` module available and functional on Windows. After installation, `import readline` should seamlessly provide command-line editing features. The example shows a basic interactive loop with exit conditions.
import sys
# On Windows, pyreadline3 often patches sys.modules['readline']
# so standard 'import readline' works. Explicit import is also possible.
try:
import readline
except ImportError:
from pyreadline3 import Readline
readline = Readline()
print("pyreadline3 is active. Try typing, using arrow keys for history, or Tab (if configured).")
print("Enter 'exit' to quit.")
while True:
try:
user_input = input(">>> ")
if user_input.lower() == 'exit':
break
if user_input:
print(f"You typed: {user_input}")
except EOFError: # Ctrl+D
print("\nExiting (Ctrl+D detected).")
break
except KeyboardInterrupt: # Ctrl+C
print("\nExiting (Ctrl+C detected).")
break
Debug
Known issues
breakingpyreadline3 currently does not work with Python 3.13.0, as Python 3.13 introduced a new REPL. Even with `PYTHON_BASIC_REPL` environment variable set, history is not preserved across sessions.fixUse Python versions prior to 3.13 or monitor the pyreadline3 GitHub repository for updates and compatibility fixes for Python 3.13+.
affects: 3.x.x with Python >= 3.13
gotchaWhen managing history files with `readline.read_history_file()`, the specified history file must already exist. If it does not, a `FileNotFoundError` will be raised.fixEnsure the history file is created (e.g., `open(filename, 'w').close()`) before attempting to read from it.
affects: All versions
gotchapyreadline3 is primarily developed and tested for Windows environments to provide GNU readline functionality where it's natively absent. While it may technically install on other OS, its primary benefit is on Windows, and behavior on Unix-like systems (which have a native `readline` module) might be unexpected or redundant.fixConfirm you need `pyreadline3` for your specific operating system. On Unix-like systems, the built-in `readline` module is usually sufficient.
affects: All versions
gotchaThe Ctrl-C key binding has configurable behavior. By default, it might act as a copy operation, requiring a double-tap within a configurable time interval (`ctrl_c_tap_time_interval`) to raise a `KeyboardInterrupt`.fixConfigure `allow_ctrl_c(True)` and adjust `ctrl_c_tap_time_interval(x)` in a configuration file (`pyreadlineconfig.ini`) or through `parse_and_bind` to customize Ctrl-C behavior.
affects: All versions
Errors
Common errors & fixes
ModuleNotFoundError: No module named 'pyreadline3'
The `pyreadline3` package has not been installed in the current Python environment.
fixpip install pyreadline3
AttributeError: module 'pyreadline3' has no attribute 'parse_and_bind'
Developers are attempting to call GNU readline-like functions directly as top-level methods of the `pyreadline3` module, instead of accessing them via the `pyreadline3.rlmain` submodule.
fiximport pyreadline3.rlmain as rl; rl.rl_parse_and_bind('tab: complete') ModuleNotFoundError: No module named 'pyreadline'
The user is trying to import the deprecated `pyreadline` package or its submodules, while intending to use the newer `pyreadline3` package.
fixEnsure `pyreadline3` is installed with `pip install pyreadline3`, and then use `import pyreadline3` or `from pyreadline3 import Readline` as appropriate.
Upgrade
Version history
3.5.6latest on PyPI · released May 14, 2026
Audit
Dependencies
No dependency data recorded yet.