Disable interactive mode (TTY) - 'pip' and progress bars problem

pip
python

#1

Is that possible to disable interactive shell (tty)? Because β€˜pip’ command if works in interactive mode shows progress bars that in CircleCI look that (every update is in new line, so it produce too much output):

0% | | 4.1kB 22.8MB/s eta 0:00:01
0% | | 8.2kB 21.8MB/s eta 0:00:01
0% | | 12kB 22.4MB/s eta 0:00:01
0% | | 16kB 20.1MB/s eta 0:00:01
0% | | 20kB 20.7MB/s eta 0:00:01
0% | | 24kB 21.6MB/s eta 0:00:01
0% | | 28kB 22.0MB/s eta 0:00:01
0% |▏ | 32kB 21.5MB/s eta 0:00:01
0% |▏ | 36kB 21.8MB/s eta 0:00:01
0% |▏ | 40kB 22.4MB/s eta 0:00:01
0% |▏ | 45kB 22.6MB/s eta 0:00:01
0% |▏ | 49kB 22.3MB/s eta 0:00:01
0% |▏ | 53kB 22.5MB/s eta 0:00:01
0% |▏ | 57kB 24.1MB/s eta 0:00:01
0% |▏ | 61kB 24.3MB/s eta 0:00:01
0% |β–Ž | 65kB 23.5MB/s eta 0:00:01
0% |β–Ž | 69kB 23.6MB/s eta 0:00:01
0% |β–Ž | 73kB 24.7MB/s eta 0:00:01
0% |β–Ž | 77kB 24.9MB/s eta 0:00:01
0% |β–Ž | 81kB 23.8MB/s eta 0:00:01
0% |β–Ž | 86kB 23.8MB/s eta 0:00:01
0% |β–Ž | 90kB 25.0MB/s eta 0:00:01
1% |β–Ž | 94kB 24.9MB/s eta 0:00:01
1% |▍ | 98kB 23.7MB/s eta 0:00:01
1% |▍ | 102kB 23.7MB/s eta 0:00:01
1% |▍ | 106kB 24.6MB/s eta 0:00:01
1% |▍ | 110kB 24.3MB/s eta 0:00:01
1% |▍ | 114kB 23.3MB/s eta 0:00:01
1% |▍ | 118kB 23.2MB/s eta 0:00:01
1% |▍ | 122kB 24.2MB/s eta 0:00:01
1% |▍ | 126kB 24.2MB/s eta 0:00:01
1% |β–Œ | 131kB 23.4MB/s eta 0:00:01
1% |β–Œ | 135kB 23.5MB/s eta 0:00:01
1% |β–Œ | 139kB 24.8MB/s eta 0:00:01
1% |β–Œ | 143kB 24.8MB/s eta 0:00:01
1% |β–Œ | 147kB 24.3MB/s eta 0:00:01
1% |β–Œ | 151kB 24.7MB/s eta 0:00:01
1% |β–Œ | 155kB 25.8MB/s eta 0:00:01
1% |β–Œ | 159kB 25.9MB/s eta 0:00:01
1% |β–‹ | 163kB 25.0MB/s eta 0:00:01
1% |β–‹ | 167kB 25.0MB/s eta 0:00:01
1% |β–‹ | 172kB 25.9MB/s eta 0:00:01
1% |β–‹ | 176kB 25.9MB/s eta 0:00:01
1% |β–‹ | 180kB 24.5MB/s eta 0:00:01
1% |β–‹ | 184kB 24.4MB/s eta 0:00:01


#2

What command are you running that you are getting progress bars from?

I use pip install -q -r requirements.txt and it it works well,

https://circleci.com/gh/drazisil/p2pool/237 is an example.


#3

I get this too. You asked what command - the default one that CircleCI infers.

if [ -e requirements.txt ]; then pip install -r requirements.txt;else pip install -r requirements.pip;fi


#4

A quick hack for those who don’t want to use -q as it removes a lot of helpful debugging info…

pip -Ur requirements.txt | tee

pip will see that sys.stdout is not a TTY and not show the progress bar!


#5

However, tee will not bail out on an error. (tee always returns regardless of what the pipe exits with)


#6

Any solution for this issue?


#7
pip -r requirements.txt | cat && test ${PIPESTATUS} -eq 0

More methods to achieve this here: https://stackoverflow.com/questions/1221833/pipe-output-and-capture-exit-status-in-bash


#8