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

ImportError: cannot import name 'BAR_TYPES' from 'pip._internal.cli.progress_bars' #324

Closed
mmdbalkhi opened this issue May 22, 2022 · 2 comments

Comments

@mmdbalkhi
Copy link

mmdbalkhi commented May 22, 2022

In this pip commit(pypa/pip@728e4fe), 'BAR_TYPES' has been removed from pip and gives an error when running a program with newer pip.

issue in pip repo: pypa/pip#10991
error:

Locking requirements/docs.in to requirements/docs.txt. References: []
ERROR executing /usr/bin/python -m piptools compile --no-header --verbose --rebuild --upgrade --no-emit-index-url --output-file requirements/docs.txt requirements/docs.in
Exit code: 1
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/mmdbalkhi/.local/lib/python3.10/site-packages/piptools/__main__.py", line 3, in <module>
    from piptools.scripts import compile, sync
  File "/home/mmdbalkhi/.local/lib/python3.10/site-packages/piptools/scripts/compile.py", line 21, in <module>
    from ..repositories import LocalRequirementsRepository, PyPIRepository
  File "/home/mmdbalkhi/.local/lib/python3.10/site-packages/piptools/repositories/__init__.py", line 1, in <module>
    from .local import LocalRequirementsRepository
  File "/home/mmdbalkhi/.local/lib/python3.10/site-packages/piptools/repositories/local.py", line 14, in <module>
    from .pypi import PyPIRepository
  File "/home/mmdbalkhi/.local/lib/python3.10/site-packages/piptools/repositories/pypi.py", line 22, in <module>
    from pip._internal.cli.progress_bars import BAR_TYPES
ImportError: cannot import name 'BAR_TYPES' from 'pip._internal.cli.progress_bars' (/home/mmdbalkhi/.local/lib/python3.10/site-packages/pip/_internal/cli/progress_bars.py)

Traceback (most recent call last):
  File "/home/mmdbalkhi/.local/lib/python3.10/site-packages/pipcompilemulti/cli_v1.py", line 26, in cli
    recompile()
  File "/home/mmdbalkhi/.local/lib/python3.10/site-packages/pipcompilemulti/actions.py", line 31, in recompile
    compile_topologically(env_confs, deduplicator)
  File "/home/mmdbalkhi/.local/lib/python3.10/site-packages/pipcompilemulti/actions.py", line 38, in compile_topologically
    if env.maybe_create_lockfile():
  File "/home/mmdbalkhi/.local/lib/python3.10/site-packages/pipcompilemulti/environment.py", line 51, in maybe_create_lockfile
    self.create_lockfile()
  File "/home/mmdbalkhi/.local/lib/python3.10/site-packages/pipcompilemulti/environment.py", line 80, in create_lockfile
    raise RuntimeError("Failed to pip-compile {0}".format(self.infile))
RuntimeError: Failed to pip-compile requirements/docs.in
@peterdemin
Copy link
Owner

Whenever this happens I either upgrade pip-tools, or (if it doesn't help) downgrade pip

@mmdbalkhi
Copy link
Author

mmdbalkhi commented May 22, 2022

thanks, @peterdemin a good temporary solution, Of course, I got it wrong, I thought the problem was with this program. Sorry

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants