-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[BUG] Double rendering of notebook output with rich>=12.6.0
#2740
Comments
What software are you using to run the Notebook? Jupyter notebook, Jupyter lab, VSCode ? |
I had the same problem, was using Jupyter lab. |
Ok, just checked again, and the problem exists with both jupyter-lab and notebook. Don't use VSCode, so don't know about that. In my case, both running on Linux, in a (newly created) conda-environment, if that makes any difference. |
FWIW, I tracked this down to #2449 setting I don't know enough about rich to identify exactly which output produced when copyable codeimport time
import rich
from rich.console import Console
from rich.progress import Progress
with Progress() as p:
for i in p.track(range(10), description="duplicate"):
time.sleep(0.1)
with Progress(console=Console(force_terminal=False)) as p:
for i in p.track(range(10), description="fixed"):
time.sleep(0.1) |
I hope we solved your problem. If you like using Rich, you might also enjoy Textual |
Describe the bug
It appears the double rendering issue referenced in #1737 has returned starting in version 12.6.0.
With a poetry environment given by:
a simple reproducing example is (from a jupyter notebook)
when
version
is set to any of12.6.0,13.0.0,13.0.1
in thepyproject.toml
above, the output of this example looks likeWhen using
<12.6.0
, you get the expectedNote that this is strictly a jupyter problem: for any of these versions, running e.g.
python -c 'from rich.progress import track;import time;[time.sleep(0.01) for _ in track(range(100))]'
results in just a single progress bar being printed, as expected.
Platform
Click to expand
What platform (Win/Linux/Mac) are you running on? What terminal software are you using?
Linux, both natively and in WSL2 on Windows.
I may ask you to copy and paste the output of the following commands. It may save some time if you do it now.
If you're using Rich in a terminal:
If you're using Rich in a Jupyter Notebook, run the following snippet in a cell
and paste the output in your bug report.
The text was updated successfully, but these errors were encountered: