简体   繁体   English

tqdm 进度条显示在两行

[英]tqdm progress bar showing up on two lines

In Jupyter on Windows my tqdm output always shows up broken into two lines.在 Windows 上的 Jupyter 中,我的 tqdm output 总是显示为分成两行。 I have yet to find a parameter combo that fixes it.我还没有找到修复它的参数组合。 Simple code that reproduces problem:重现问题的简单代码:

from tqdm import tqdm
import time
for ind in tqdm(range(1000), position=0, leave=True):
    time.sleep(0.1)

Here's what it looks like:这是它的样子: tqdm 两行

Based on some stuff online I've tried installing colorama package and it makes no difference.根据网上的一些东西,我尝试安装colorama package 并没有什么区别。 If possible I want the code to be usable in ipython, terminal, etc as I am putting it in a package that is used in many platforms.如果可能的话,我希望代码可以在 ipython、终端等中使用,因为我将它放在用于许多平台的 package 中。

Try changing your import to: from tqdm.auto import tqdm尝试将您的导入更改为: from tqdm.auto import tqdm

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM