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

TypeError: WheelCache.__init__() takes 2 positional arguments but 3 were given #1854

Closed
mishbahr opened this issue Apr 26, 2023 · 5 comments
Closed
Labels
bug Something is not working pip Related to pip

Comments

@mishbahr
Copy link

mishbahr commented Apr 26, 2023

Running "pip-compile" using "pre-commit"

  - repo: "https://github.com/jazzband/pip-tools"
    rev: 6.12.3
    hooks:
      - id: pip-compile
        name: update requirements.txt
        files: ^requirements\.in$
        args:
          - "--quiet"
          - "--index-url=http://pypi.example.co.uk/simple/"
          - "--resolver=backtracking"

I get an error.

Environment Versions

  1. OS Type: Docker/python:3.9.14
  2. Python version: 3.9.14
  3. pip version: 23.0.1
  4. pip-tools version: 6.12.3

Steps to replicate

Use pre-commit hook to compile requirements.in file

Expected result

pre-commit hook to pass

Actual result

update requirements.txt..................................................Failed

Traceback (most recent call last):
  File "/root/.cache/pre-commit/repo6dhyz3vc/py_env-python3.9/bin/pip-compile", line 8, in <module>
    sys.exit(cli())
  File "/root/.cache/pre-commit/repo6dhyz3vc/py_env-python3.9/lib/python3.9/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/root/.cache/pre-commit/repo6dhyz3vc/py_env-python3.9/lib/python3.9/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/root/.cache/pre-commit/repo6dhyz3vc/py_env-python3.9/lib/python3.9/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/root/.cache/pre-commit/repo6dhyz3vc/py_env-python3.9/lib/python3.9/site-packages/click/core.py", line [76](https://git.iwoca.co.uk/iwoca/etl/tasks/my-etl-task/-/jobs/9884198#L76)0, in invoke
    return __callback(*args, **kwargs)
  File "/root/.cache/pre-commit/repo6dhyz3vc/py_env-python3.9/lib/python3.9/site-packages/click/decorators.py", line 26, in new_func
    return f(get_current_context(), *args, **kwargs)
  File "/root/.cache/pre-commit/repo6dhyz3vc/py_env-python3.9/lib/python3.9/site-packages/piptools/scripts/compile.py", line 589, in cli
    results = resolver.resolve(max_rounds=max_rounds)
  File "/root/.cache/pre-commit/repo6dhyz3vc/py_env-python3.9/lib/python3.9/site-packages/piptools/resolver.py", line 545, in resolve
    wheel_cache = WheelCache(
TypeError: __init__() takes 2 positional arguments but 3 were given

Thanks in advance.

@atugushev
Copy link
Member

atugushev commented Apr 26, 2023

Upgrade pip-tools to6.13.0 version. More details:

@atugushev atugushev marked this as a duplicate of #1852 Apr 26, 2023
@atugushev atugushev changed the title TypeError: __init__() takes 2 positional arguments but 3 were given TypeError: WheelCache.__init__() takes 2 positional arguments but 3 were given Apr 26, 2023
@atugushev atugushev pinned this issue Apr 26, 2023
@mishbahr
Copy link
Author

Yup. Will try. Thanks

@credativ-dar
Copy link

Thanks for pinning, for some reason Google is unable to find this 😕

@atugushev atugushev unpinned this issue Jul 14, 2023
@eduardolucioac
Copy link

Upgrading "pip-tools" is solution...

pip install --upgrade pip-tools

Thanks! 😎

@ice1x
Copy link

ice1x commented Apr 18, 2024

Have the same issue with
Python==3.11
pip==24.0
pip-tools==7.4.1
pip-compile==6.12.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something is not working pip Related to pip
Projects
None yet
Development

No branches or pull requests

5 participants