Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error importing BAR_TYPES with new pip 22.1 release #1617

Closed
kabirkhan opened this issue May 11, 2022 · 20 comments · Fixed by #1618 or charmed-kubernetes/jenkins#1123
Closed

Error importing BAR_TYPES with new pip 22.1 release #1617

kabirkhan opened this issue May 11, 2022 · 20 comments · Fixed by #1618 or charmed-kubernetes/jenkins#1123

Comments

@kabirkhan
Copy link

kabirkhan commented May 11, 2022

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

  1. pip install -U pip pip-tools
  2. 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)
@jason-nance
Copy link

Looks like BAR_TYPES was removed in this commit.

@AndydeCleyre
Copy link
Contributor

There's a fix for this in the new resolver PR, and we either need pull that bit out for a more immediate release, or finalize and merge that PR, which still has at least one problem.

@klimburg
Copy link

Just hit this in our CI

@pradyunsg
Copy link
Contributor

Pulling that out into a more immediate release seems reasonable to me. :)

@lafolle
Copy link

lafolle commented May 11, 2022

For now i am just pinning pip to 22.0.4. Looking forward to the fix!

@AndydeCleyre
Copy link
Contributor

I can't be at a computer for a little while, @atugushev want to do a small release soon?

@deifactor
Copy link

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?

@wizpig64
Copy link
Contributor

wizpig64 commented May 11, 2022

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: #1558 (comment)

krmax44 added a commit to okfde/fragdenstaat_de that referenced this issue May 12, 2022
karlb added a commit to raiden-network/raiden that referenced this issue May 12, 2022
A new version of pip removed a variable used by piptools. Pin the pip
version to avoid running into this problem.

See jazzband/pip-tools#1617.
ranrubin added a commit to Deci-AI/super-gradients that referenced this issue May 12, 2022
@BarnabasSzabolcs
Copy link

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...)

ViacheslavKolupaev added a commit to ViacheslavKolupaev/notebook that referenced this issue May 12, 2022
iloveagent57 pushed a commit to openedx/enterprise-catalog that referenced this issue May 12, 2022
Also temporarily pins pip<22.1 in pip-tools.txt while jazzband/pip-tools#1617 is addressed.
ENT-5823
@hugovk
Copy link
Member

hugovk commented May 12, 2022

I'm a bit puzzled why pip and pip-tools are not kept within the same project.

This also came up the last quarter, so I'll repeat #1558 (comment):

I'm not sure whether a change in organisation would necessarily help, the pip team will continue to change their private internal functions as they need to (and there will be more changes to use Rich more for better output).

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 #1558 (comment):

Wherever it lives, I'd suggest a closer eye is paid to the integration of pip with pip-tools, especially in the lead up to pip's quarterly releases. (And look out for the pip release issues for planned release dates e.g. pypa/pip#10726.)

noliveleger pushed a commit to kobotoolbox/kpi that referenced this issue Jun 14, 2022
zmc added a commit to ceph/teuthology that referenced this issue Jun 28, 2022
Fixes jazzband/pip-tools#1617

Signed-off-by: Zack Cerza <zack@redhat.com>
zmc added a commit to ceph/teuthology that referenced this issue Jun 28, 2022
Fixes jazzband/pip-tools#1617

Signed-off-by: Zack Cerza <zack@redhat.com>
@hugo2121-trip
Copy link

what was the fix there?
I got same issue with

pip version 22.1.2 (also tried 22.0.4)
pip-tools version 6.8.0

@AndydeCleyre
Copy link
Contributor

@hugo2121-trip

Can you provide a reproducible procedure?

@hugovk hugovk reopened this Jul 1, 2022
@hugovk
Copy link
Member

hugovk commented Jul 1, 2022

Sorry I clicked the wrong button!

@hugo2121-trip
Copy link

@hugo2121-trip

Can you provide a reproducible procedure?

thanks for replying. I fixed the issue. My team is using tox to run some command, and seems tox using pip 22.1.2 under the hood.

I made some dependencies change to force using some version:

pip == 22.0.4
pip-tools==5.4.0

and fixed the issue.

@thehackermonkey
Copy link

For me it worked after doing:

  1. pip install pip==22.0.4
  2. pip install --upgrade pip-tools

Thanks to @lafolle for pointing the latest working version.

@kijewskimateusz
Copy link

kijewskimateusz commented Jul 14, 2022

EDIT: Have been using old version of PIP-Tools in Pre-Commit

@matheusft
Copy link

For me it worked after doing:

  1. pip install pip==22.0.4
  2. pip install --upgrade pip-tools

Thanks to @lafolle for pointing the latest working version.

That worked fine for me. Thanks =)

karlb added a commit to raiden-network/raiden-common that referenced this issue Jul 28, 2022
MichaelRoytman added a commit to edx/edx-name-affirmation that referenced this issue Aug 2, 2022
This commit upgrades the version of pip-tools used in this repository from 6.6.0 to 6.6.2.

In version 6.6.0 of pip-tools, there is a bug that is preventing pip-tools from working. This is breaking the Python requirements update GitHub action in this repository.

The error is "ImportError: cannot import name 'BAR_TYPES' from 'pip._internal.cli.progress_bars'". The error was reported here: jazzband/pip-tools#1617. The fix to this bug was released in version 6.6.2 of pip-tools. See the comment here: jazzband/pip-tools#1617 (comment).

Version 6.6.1 of pip-tools also has a bug, which is fixed in version 6.6.2. I observed this issue breaking the Python requirements update GitHub action in another repository, so I have upgrade the version straight to 6.6.2. The issue in version 6.6.1 was reported here: jazzband/pip-tools#1624.
nedbat added a commit to nedbat/coveragepy that referenced this issue Nov 5, 2022
jazzband/pip-tools#1617 was fixed in pip-tools==6.6.1
tecoholic added a commit to open-craft/enterprise-catalog that referenced this issue Jan 23, 2023
The pip-tools version currently used breaks with the error
"ImportError: cannot import name 'BAR_TYPES' from 'pip._internal.cli.progress_bars'"
during the deployment. This is fixed in the version 6.6.2 as reported
in jazzband/pip-tools#1617.

So, this commit pins the pip-tools version to 6.6.2
johnnagro pushed a commit to openedx/enterprise-catalog that referenced this issue Apr 25, 2023
The pip-tools version currently used breaks with the error
"ImportError: cannot import name 'BAR_TYPES' from 'pip._internal.cli.progress_bars'"
during the deployment. This is fixed in the version 6.6.2 as reported
in jazzband/pip-tools#1617.

So, this commit pins the pip-tools version to 6.6.2
tecoholic added a commit to open-craft/edx-enterprise that referenced this issue Jul 6, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet