Rich
raw JSON → 14.3.0 verified Tue May 12 auth: no python install: verified quickstart: verified
Rich is a powerful Python library designed for creating rich text and beautiful formatting in the terminal. It provides an intuitive API to add color and style to terminal output, and can render advanced content such as pretty tables, dynamic progress bars, formatted Markdown, syntax-highlighted source code, and enhanced tracebacks. The library is actively maintained by Textualize and works across Linux, macOS, and Windows, requiring Python 3.8 or later.
pip install rich Warnings
breaking Console markup syntax was significantly updated in versions leading up to 13.0.0. Python structures like `[1,2,3]` are no longer parsed as markup, and standard color numbers syntax changed from `[5]` to `color(<number>)`. The markup escape method changed from double brackets (e.g., `foo[[]]`) to preceding with a backslash (e.g., `foo\[bar]`). ↓
fix Review and update console markup strings according to the new syntax outlined in the Rich documentation, particularly regarding bracket usage and color specification.
breaking Version 12.0.0 dropped support for Python 3.7. Rich now officially requires Python 3.8 or later. ↓
fix Ensure your project runs on Python 3.8 or a newer version.
breaking As of Rich 14.0.0, empty `NO_COLOR` and `FORCE_COLOR` environment variables are now considered disabled, impacting how Rich decides to render colored output. ↓
fix If relying on these environment variables for color control, ensure they are set to appropriate values (e.g., `1` for `FORCE_COLOR` to force color, or `0` for `NO_COLOR` to disable it) rather than being empty.
gotcha Rich's `Console.print()` method (and `rich.print`) automatically highlights Python data structures and syntax. If this automatic highlighting of elements like braces, commas, or numbers is undesired (e.g., when trying to achieve a very specific plain style), it needs to be explicitly disabled. ↓
fix Pass `highlight=False` to the `console.print()` method (e.g., `console.print('[[green]1[/green]] Create new password', highlight=False)`).
gotcha PyCharm's default run console often does not fully emulate a terminal, which can prevent Rich from rendering styled output correctly. ↓
fix In PyCharm, enable the 'Emulate terminal in output console' option in your run/debug configurations for projects using Rich.
Install
pip install "rich[jupyter]" Install compatibility verified last tested: 2026-05-12
python os / libc variant status wheel install import disk
3.10 alpine (musl) jupyter - - 0.01s 83.0M
3.10 alpine (musl) rich - - 0.01s 30.0M
3.10 alpine (musl) rich - - 0.18s 30.0M
3.10 slim (glibc) jupyter - - 0.00s 83M
3.10 slim (glibc) rich - - 0.00s 30M
3.10 slim (glibc) rich - - 0.23s 30M
3.11 alpine (musl) jupyter - - 0.02s 87.7M
3.11 alpine (musl) rich - - 0.02s 33.0M
3.11 alpine (musl) rich - - 0.27s 32.9M
3.11 slim (glibc) jupyter - - 0.01s 88M
3.11 slim (glibc) rich - - 0.01s 33M
3.11 slim (glibc) rich - - 0.22s 33M
3.12 alpine (musl) jupyter - - 0.01s 78.4M
3.12 alpine (musl) rich - - 0.01s 24.6M
3.12 alpine (musl) rich - - 0.22s 24.6M
3.12 slim (glibc) jupyter - - 0.02s 79M
3.12 slim (glibc) rich - - 0.01s 25M
3.12 slim (glibc) rich - - 0.22s 25M
3.13 alpine (musl) jupyter - - 0.01s 78.2M
3.13 alpine (musl) rich - - 0.01s 24.4M
3.13 alpine (musl) rich - - 0.22s 24.3M
3.13 slim (glibc) jupyter - - 0.01s 79M
3.13 slim (glibc) rich - - 0.01s 25M
3.13 slim (glibc) rich - - 0.21s 25M
3.9 alpine (musl) jupyter - - 0.01s 58.9M
3.9 alpine (musl) rich - - 0.01s 29.2M
3.9 alpine (musl) rich - - 0.12s 29.2M
3.9 slim (glibc) jupyter - - 0.00s 59M
3.9 slim (glibc) rich - - 0.00s 30M
3.9 slim (glibc) rich - - 0.10s 30M
Imports
- print
from rich import print - Console
from rich.console import Console - install
from rich.pretty import install - inspect
from rich import inspect - Table
from rich.table import Table - Progress
from rich.progress import Progress - Markdown
from rich.markdown import Markdown - Syntax
from rich.syntax import Syntax
Quickstart verified last tested: 2026-04-23
from rich import print
from rich.console import Console
from rich.table import Table
# Using rich.print as a drop-in replacement
print("[bold magenta]Hello[/bold magenta] [green]Rich[/green] World!")
# Using Console for more control
console = Console()
console.log("This is a log message with [blue]timestamp[/blue] and file info.")
# Creating a simple table
table = Table(title="Example Table")
table.add_column("Header 1", style="cyan", no_wrap=True)
table.add_column("Header 2", style="magenta")
table.add_row("Row 1, Cell 1", "Row 1, Cell 2")
table.add_row("Row 2, Cell 1", "Row 2, Cell 2")
console.print(table)