alive_progress bar not working on PyCharm
Asked Answered
C

2

5

I am trying to use the alive_progress alive_bar on PyCharm but it only appears in the console once the whole process has finished. Instead, I want it to display and progress as the for loop operates.

Toy example:

from alive_progress import alive_bar
import time

bar_l = 100
with alive_bar(bar_l) as bar:
    for i in range(bar_l):
        time.sleep(0.001)
        bar()

Has anyone else encountered this problem?

Cloud answered 3/3, 2022 at 2:35 Comment(0)
L
10

There is a option to force enable it and see alive-progress in PyCharm. It's "force_tty=True"

with alive_bar(1000, force_tty=True) as bar:
for i in range(1000):
    time.sleep(.01)
    bar()
Larner answered 3/3, 2022 at 2:48 Comment(0)
O
0

Official documentation, i.e., alive_progress's GitHub repository, mentions that due to PyCharm's default settings, alive_bar is not working properly in PyCharm's console. To change that, please follow the instructions at https://github.com/rsalmei/alive-progress/blob/main/README.md#forcing-animations-on-pycharm-jupyter-etc

Outbreak answered 12/10 at 17:54 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.