question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] Can't print in Jupyter console or qtconsole (but can in jupyter lab)

See original GitHub issue

image This is what I get when I try to do rich.print in jupyter console or qtconsole. But in jupyterlab it is able to print.

I have installed rich using pip install rich[jupyter] Python version: 3.9 Jupyter (qt)console version: Latest

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:20 (7 by maintainers)

github_iconTop GitHub Comments

2reactions
arobergecommented, Mar 7, 2021
import colorama
from rich.console import Console
from rich.markdown import Markdown
from rich.syntax import Syntax

colorama.deinit()
colorama.init(convert=False, strip=False)
console = Console(force_jupyter=False, color_system="truecolor")
# same example as before follows

image

That’s probably a work around which could be suggested to other QtConsole users on Windows. For my own purpose, I’ll just need to change the theme.

2reactions
arobergecommented, Mar 7, 2021

I have been playing with colorama.deinit() after importing modules from Rich, and doing colorama.init() with different options. This seems to work after a fashion: the colour output is renabled when printing with ansi codes directly; italics in markdown are supported and the number for list items are in red (I don’t know if this is supposed to be the case).

I’ll play with it some more and see if I can get something to work. image

Read more comments on GitHub >

github_iconTop Results From Across the Web

[BUG] Can't print in Jupyter console or qtconsole (but ... - GitHub
But in jupyterlab it is able to print. I have installed rich using pip install rich[jupyter] Python version: 3.9 Jupyter (qt)console ...
Read more >
Developers - [BUG] Can't print in Jupyter console or qtconsole (but ...
This is what I get when I try to do rich.print in jupyter console or qtconsole. But in jupyterlab it is able to...
Read more >
Magic %qtconsole problem Jupyter notebook - Stack Overflow
Hi guys I have a great problem: when i develop my model on jupyter notebook, i'm used to write the command: %qtconsole.
Read more >
The Qt Console for Jupyter — Jupyter Qt Console 5.4.0 ...
The Qt console can use any Jupyter kernel. ... The widget also exposes the ability to print directly, via the default print shortcut...
Read more >
Jupyter Documentation - Read the Docs
The Jupyter Lab interface is a more extensible and composable ... By default, notebook errors will be raised and printed into the terminal....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found