pip-tools: Error importing BAR_TYPES with new pip 22.1 release
pip-tools breaks with the new version of pip “22.1”. Error:
ImportError: cannot import name 'BAR_TYPES' from 'pip._internal.cli.progress_bars' (/tmp/tmpxfal9pqx/6297f3abdc8a9aff/test-env/lib/python3.9/site-packages/pip/_internal/cli/progress_bars.py)
Environment Versions
OS: Ubuntu 20.04 Python version: 3.9 pip version: 22.1 pip-tools version: 6.6.0
Steps to replicate
- pip install -U pip pip-tools
- pip-compile requirements.in
Expected result
Compilation is successful
Actual result
Full traceback from my CI job.
Traceback (most recent call last):
File "/tmp/tmpxfal9pqx/6297f3abdc8a9aff/test-env/bin/pip-compile", line 5, in <module>
from piptools.scripts.compile import cli
File "/tmp/tmpxfal9pqx/6297f3abdc8a9aff/test-env/lib/python3.9/site-packages/piptools/scripts/compile.py", line 21, in <module>
from ..repositories import LocalRequirementsRepository, PyPIRepository
File "/tmp/tmpxfal9pqx/6297f3abdc8a9aff/test-env/lib/python3.9/site-packages/piptools/repositories/__init__.py", line 1, in <module>
from .local import LocalRequirementsRepository
File "/tmp/tmpxfal9pqx/6297f3abdc8a9aff/test-env/lib/python3.9/site-packages/piptools/repositories/local.py", line 14, in <module>
from .pypi import PyPIRepository
File "/tmp/tmpxfal9pqx/6297f3abdc8a9aff/test-env/lib/python3.9/site-packages/piptools/repositories/pypi.py", line 23, in <module>
from pip._internal.cli.progress_bars import BAR_TYPES
ImportError: cannot import name 'BAR_TYPES' from 'pip._internal.cli.progress_bars' (/tmp/tmpxfal9pqx/6297f3abdc8a9aff/test-env/lib/python3.9/site-packages/pip/_internal/cli/progress_bars.py)
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Reactions: 93
- Comments: 20 (9 by maintainers)
Commits related to this issue
- 👷 temporarily pin pip version see jazzband/pip-tools#1617 — committed to okfde/fragdenstaat_de by krmax44 2 years ago
- Work around " Error importing BAR_TYPES" in pip A new version of pip removed a variable used by piptools. Pin the pip version to avoid running into this problem. See https://github.com/jazzband/pip-... — committed to raiden-network/raiden by karlb 2 years ago
- fixing pip version to 22.0.4 as 22.1 breaks https://github.com/jazzband/pip-tools/issues/1617 — committed to Deci-AI/super-gradients by ranrubin 2 years ago
- Fix error importing BAR_TYPES See: https://github.com/jazzband/pip-tools/issues/1617 — committed to ViacheslavKolupaev/notebook by ViacheslavKolupaev 2 years ago
- fix: filter exec-ed/bootcamp data from enterprise catalog service Also temporarily pins pip<22.1 in pip-tools.txt while https://github.com/jazzband/pip-tools/issues/1617 is addressed. ENT-5823 — committed to openedx/enterprise-catalog by johnnagro 2 years ago
- pin pip version due to jazzband/pip-tools#1617 — committed to kobotoolbox/kobocat by joshuaberetta 2 years ago
- pin pip version due to jazzband/pip-tools#1617 — committed to kobotoolbox/kpi by joshuaberetta 2 years ago
- pin pip version due to jazzband/pip-tools#1617 — committed to kobotoolbox/kobocat by joshuaberetta 2 years ago
- 👷♀️ FIX the ci failed tests because pip screw up See https://github.com/jazzband/pip-tools/issues/1617#issuecomment-1124289479 — committed to GreenDeploy-io/dockerized-django-demo-circleci by simkimsia 2 years ago
- 👷♀️ FIX the ci failed tests because pip screw up See https://github.com/jazzband/pip-tools/issues/1617#issuecomment-1124289479 👷♀️ — committed to GreenDeploy-io/dockerized-django-demo-circleci by simkimsia 2 years ago
- chore: make upgrade to bump pip-tools This is just a routine invocation of make upgrade, motivated by the recent release of pip-tools 6.6.1 which fixes a compatibility issue with pip that is currentl... — committed to openedx/edx-platform by pwnage101 2 years ago
- fix: Error importing BAR_TYPES with new pip 22.1 release Changes: - upgrade pip-tools to 6.6.1 according to https://github.com/jazzband/pip-tools/issues/1617#issuecomment-1126245586 — committed to cmltaWt0/enterprise-catalog by cmltaWt0 2 years ago
- fix: Error importing BAR_TYPES with new pip 22.1 release Changes: - upgrade pip-tools to 6.6.1 according to https://github.com/jazzband/pip-tools/issues/1617#issuecomment-1126245586 — committed to cmltaWt0/enterprise-catalog by cmltaWt0 2 years ago
- fix: Error importing BAR_TYPES with new pip 22.1 release Changes: - upgrade pip-tools to 6.6.1 according to https://github.com/jazzband/pip-tools/issues/1617#issuecomment-1126245586 — committed to cmltaWt0/license-manager by cmltaWt0 2 years ago
- fix: Error importing BAR_TYPES with new pip 22.1 release Changes: - upgrade pip-tools to 6.6.1 according to https://github.com/jazzband/pip-tools/issues/1617#issuecomment-1126245586 — committed to cmltaWt0/license-manager by cmltaWt0 2 years ago
- fix: Error importing BAR_TYPES with new pip 22.1 release Changes: - upgrade pip-tools to 6.6.1 according to https://github.com/jazzband/pip-tools/issues/1617#issuecomment-1126245586 — committed to cmltaWt0/enterprise-catalog by cmltaWt0 2 years ago
- fix: Error importing BAR_TYPES with new pip 22.1 release Changes: - upgrade pip-tools to 6.6.1 according to https://github.com/jazzband/pip-tools/issues/1617#issuecomment-1126245586 — committed to cmltaWt0/enterprise-catalog by cmltaWt0 2 years ago
- fix: Error importing BAR_TYPES with new pip 22.1 release Changes: - upgrade pip-tools to 6.6.1 according to https://github.com/jazzband/pip-tools/issues/1617#issuecomment-1126245586 — committed to cmltaWt0/enterprise-catalog by cmltaWt0 2 years ago
- fix: Error importing BAR_TYPES with new pip 22.1 release Changes: - upgrade pip-tools to 6.6.1 according to https://github.com/jazzband/pip-tools/issues/1617#issuecomment-1126245586 — committed to cmltaWt0/enterprise-catalog by cmltaWt0 2 years ago
Fix released as part of
pip-tools v6.6.1.For me it worked after doing:
pip install pip==22.0.4pip install --upgrade pip-toolsThanks to @lafolle for pointing the latest working version.
I’m a bit puzzled why pip and pip-tools are not kept within the same project.
pip-tools is instrumental to using pip since pip-compiles enables devs to separate direct dependencies from indirect ones. Also, it is great for fixing versions. (it makes the pip system work just like packages.json and npm…)
For now i am just pinning
pipto 22.0.4. Looking forward to the fix!That commit has been in the pip main branch for a month. ideally, this repo should be testing against that regularly to catch for this kind of thing early, rather than needing to add a version cap that would just get in the way later.
oh dear, it does regularly check for this: https://github.com/jazzband/pip-tools/runs/6267937837?check_suite_focus=true
edit: oh yeah, here’s where the relevant discussion continues, back through this wormhole to January: https://github.com/jazzband/pip-tools/issues/1558#issuecomment-1026462006
IIRC this isn’t the first time a new pip release has broken pip-tools. Would it be a good idea to have upper bounds in its dependency?
This also came up the last quarter, so I’ll repeat https://github.com/jazzband/pip-tools/issues/1558#issuecomment-1026655582:
Also, the pip team are very busy working on pip and we can’t expect them to maintain pip-tools as well.
In fact, moving pip-tools out of Jazzband would be a backwards step: it would mean that fewer people are able to maintain it.
As noted by @wizpig64 above, pip-tools does indeed have a daily cron regularly testing against pip’s main branch, in fact it did catch the change in pip (but remember: pip has no official API) and started failing a month ago.
This also happened last quarter, so I’ll also repeat https://github.com/jazzband/pip-tools/issues/1558#issuecomment-1026655582:
Pulling that out into a more immediate release seems reasonable to me. 😃
Please stop suggesting upper bounds pins, they would make everything much, much worse.
That worked fine for me. Thanks =)
Thanks for getting this done so quickly 😃