I want use progress bars in my python code. I know there are many libraries for that but I want to use the progress bars used by pip [the package manager]. Please tell if there is a way to do this.
Asked
Active
Viewed 5,400 times
8
-
[Souce code of pip](https://github.com/pypa/pip). It's probably in _vendor/progress and it's used in _internal/cli – Wups Oct 27 '20 at 08:27
-
The answers below are outdated. Pip now has a nicer progress bar with color. more info here: https://stackoverflow.com/questions/71923704/new-color-terminal-prograss-bar-in-pip – J'e Nov 16 '22 at 19:07
3 Answers
8
The progress package available on pypi is used by pip. It can be imported by including the following line in your python file:
from pip._vendor import progress
Usage is available on https://pypi.org/project/progress/

ty.py
- 169
- 1
- 7
-
1This does not seem to work anymore (pip 22.1), the pip progress bar is now under `pip._vendor.rich.progress`. – Yannick Copin May 20 '22 at 09:39
4
Here, you can use tqdm. And you can customize it to any extent.

Rohit Kewalramani
- 408
- 5
- 15
-
-
pip uses it's own progress bar (their own source code), check their codebase: https://github.com/pypa/pip/blob/master/src/pip/_vendor/progress/bar.py – Rohit Kewalramani Oct 27 '20 at 08:29
-
-
Yes (would be quite complex though), depends on how you plan to use it. Take the inspiration from the following codebase https://github.com/pypa/pip/blob/master/src/pip/_internal/cli/progress_bars.py. This will be an uphill task. – Rohit Kewalramani Oct 27 '20 at 08:39
-
I found that pip internally uses [progress](https://pypi.org/project/progress/) for its progress bars. They have copied the whole package inside the [_vendor](https://github.com/pypa/pip/tree/master/src/pip/_vendor). And there are many more there. – ty.py Oct 27 '20 at 09:59