Rich
Dev ToolsRich is a Python library for rich text and beautiful formatting in the terminal.
Release History
v14.3.31 fixThis patch release addresses a critical bug by fixing an infinite loop found in the grapheme splitting functionality.
v14.3.22 fixesThis patch release addresses specific bugs related to ZWJ sequences and control code width reporting.
v14.3.11 fixThis patch release fixes an issue where characters outside the standard unicode range were incorrectly reported as having a cell size of 0.
v14.3.05 fixes4 featuresThis release introduces support for multi-codepoint emojis and includes several improvements to Markdown rendering. Numerous bug fixes address issues related to progress bars, padding, and soft wrapping.
v14.2.0The release adds compatibility with the newly released Python 3.14.
v14.1.0Breaking3 fixes3 featuresRich 14.1.0 adds nested live objects, a new `padding` property for `Syntax`, and the `TTY_INTERACTIVE` env var, while removing the `typing_extensions` runtime dependency and fixing several bugs.
v14.0.0Breaking4 featuresRich 14.0.0 adds the `TTY_COMPATIBLE` env var, updates color‑env‑var semantics, and enhances traceback rendering with notes, exception groups, and revised indentation.
Common Errors
UnicodeEncodeError3 reportsUnicodeEncodeError in rich arises when it attempts to print Unicode characters to a terminal or file that doesn't support them, often due to an incorrect encoding setting. To fix this, explicitly set the environment's encoding to UTF-8 before running your script, such as through `chcp 65001` in Windows before running the Python command, or by setting the PYTHONIOENCODING environment variable to utf-8. Ensure your output stream (terminal or file) also supports UTF-8.
RecursionError1 reportRecursionError in rich typically occurs when rendering deeply nested data structures or tracebacks, leading to excessive recursion exceeding Python's limit. To fix it, increase `recursion_limit` via `sys.setrecursionlimit` before rendering the data, or more effectively, simplify the data structure or traceback rendering to reduce nesting depth, for example, by limiting the depth of displayed data.
NotImplementedError1 reportA NotImplementedError in rich usually means a required method or functionality is missing in a class, often in a custom class that inherits from a rich class. To fix this, identify the missing method (indicated in the traceback) and implement it in your derived class, ensuring it provides the expected behavior for rich's functionalities like rendering or displaying objects. Also,check that rich's required dependencies are correctly installed, as missing modules can sometimes indirectly trigger this error.
RefereenceError1 reportReferenceError in rich often arises when attempting to render objects that rely on weak references (e.g., proxies to objects that have already been garbage collected). To fix it, ensure the objects you're printing with `console.print` or similar rich functions are still valid and haven't been garbage collected; consider holding a strong reference to prevent premature disposal, convert proxies to their referenced objects if possible, or handle `ReferenceError` exceptions gracefully.
Related Dev Tools Packages
Empowering everyone to build reliable and efficient software.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
Playwright is a framework for Web Testing and Automation. It allows testing Chromium, Firefox and WebKit with a single API.
Next generation frontend tooling. It's fast!
An extremely fast Python package and project manager, written in Rust.
A bundler for javascript and friends. Packs many modules into a few bundled assets. Code Splitting allows for loading parts of the application on demand. Through "loaders", modules can be CommonJs, AMD, ES6 modules, CSS, Images, JSON, Coffeescript, LESS, ... and your custom stuff.
Subscribe to Updates
Get notified when new versions are released