stdout progress bars don't work in Pycharm

10,090

Solution 1

CrazyCoder's comment is the right way to go.

I just formalize his comment as an answer here.


Step1: Go to Run ---> Edit Configurations

enter image description here

Step2: Check the option: Emulate terminal in output console

enter image description here

Voilà

enter image description here

Solution 2

The only way I managed to get progress bars (I'm using tqdm 4.19.5 for a progress bar, PyCharm Community 2017.3.2 and Anaconda/Python 3.6.3) to work correctly was to uncheck the "Show command line afterwards" option:

enter image description here

enter image description here

enter image description here

The solution posted by Tay2510 (checking the "Emulate terminal in output console" option) didn't work for me.

One downside of my solution is that you lose console access after your script is done running.

Share:
10,090
Dims
Author by

Dims

Software developer & Machine Learning engineer C/C++/Java/C#/Python/Mathematica/MATLAB/Kotlin/R/PHP/JavaScript/SQL/HTML/ LinkedIn: http://www.linkedin.com/in/dimskraft Telegram: https://t.me/dims12 I prefer fishing rod over fish.

Updated on June 06, 2022

Comments

  • Dims
    Dims about 2 years

    Many programs display progress bars by prnting to stdout and then returning to beginnign of line and pronting again. This way they achieve realtime progress bar appearence.

    Unfortunately, in many cases this functionality does not work in PyCharm's console.

    This is an example on how it shows keras train progress bar:

    enter image description here

    i.e. each progress bar change goes to separate line.

    Is it possible to fix this?