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

AttributeError: type object '_CleanResult' has no attribute 'from_link' crash on v21.2.3 #10280

Closed
1 task done
murrple-1 opened this issue Aug 6, 2021 · 4 comments · Fixed by #10282
Closed
1 task done
Labels
type: bug A confirmed bug or unintended behavior
Milestone

Comments

@murrple-1
Copy link

murrple-1 commented Aug 6, 2021

Description

AttributeError raised during pip install -r requirements.txt

Expected behavior

Installation should not raise error

pip version

21.2.3

Python version

3.6.14

OS

Docker image python:3.6.0 sha256:a1782fa44ef7b53a653d51e20b961b90847ee6b6b95eeba619db8aa8b868e440

How to Reproduce

  1. Install pip 21.2.3 globally: pip install -U pip==21.2.3
  2. Run pip install -r requirements.txt. requirements.txt looks like:
Django==3.0.2
psycopg2-binary==2.8.4
mysqlclient==1.4.6
ujson==2.0.2
uWSGI==2.0.18
jsonschema==3.2.0
pyotp==2.3.0
qrcode[pil]==6.1
filelock==3.0.12
pyparsing==2.4.6
validate-email==1.3
python-dateutil==2.8.1
password-hashing-python==0.3.0
quick-email==0.5.0
  1. AttributeError is raised

I wish I could provide more than that.

Output

ERROR: Exception:
Traceback (most recent call last):
  File "/builds/.venv/lib/python3.6/site-packages/pip/_internal/cli/base_command.py", line 173, in _main
    status = self.run(options, args)
  File "/builds/.venv/lib/python3.6/site-packages/pip/_internal/cli/req_command.py", line 203, in wrapper
    return func(self, options, args)
  File "/builds/.venv/lib/python3.6/site-packages/pip/_internal/commands/install.py", line 316, in run
    reqs, check_supported_wheels=not options.target_dir
  File "/builds/.venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/resolver.py", line 95, in resolve
    collected.requirements, max_rounds=try_to_avoid_resolution_too_deep
  File "/builds/.venv/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 472, in resolve
    state = resolution.resolve(requirements, max_rounds=max_rounds)
  File "/builds/.venv/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 366, in resolve
    failure_causes = self._attempt_to_pin_criterion(name)
  File "/builds/.venv/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 212, in _attempt_to_pin_criterion
    criteria = self._get_updated_criteria(candidate)
  File "/builds/.venv/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 203, in _get_updated_criteria
    self._add_to_criteria(criteria, requirement, parent=candidate)
  File "/builds/.venv/lib/python3.6/site-packages/pip/_vendor/resolvelib/resolvers.py", line 168, in _add_to_criteria
    candidates=build_iter_view(matches),
  File "/builds/.venv/lib/python3.6/site-packages/pip/_vendor/resolvelib/structs.py", line 164, in build_iter_view
    matches = list(matches)
  File "/builds/.venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 417, in <genexpr>
    and all(req.is_satisfied_by(c) for req in requirements[identifier])
  File "/builds/.venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/factory.py", line 417, in <genexpr>
    and all(req.is_satisfied_by(c) for req in requirements[identifier])
  File "/builds/.venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/requirements.py", line 39, in is_satisfied_by
    return candidate == self.candidate
  File "/builds/.venv/lib/python3.6/site-packages/pip/_internal/resolution/resolvelib/candidates.py", line 172, in __eq__
    return links_equivalent(self._link, other._link)
  File "/builds/.venv/lib/python3.6/site-packages/pip/_internal/models/link.py", line 288, in links_equivalent
    return _CleanResult.from_link(link1) == _CleanResult.from_link(link2)
AttributeError: type object '_CleanResult' has no attribute 'from_link'

Code of Conduct

@murrple-1 murrple-1 added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Aug 6, 2021
@uranusjr
Copy link
Member

uranusjr commented Aug 7, 2021

Thanks for the report. This looks like yet another Python patch-level typing incompatibility.

https://docs.python.org/3.6/library/typing.html#typing.NamedTuple

Changed in version 3.6.1: Added support for default values, methods, and docstrings.

So everything other than 3.6.0 is fine, which is why we didn’t get this earlier. I hope Python never does this again, this 3.6.x compatibility level thing is painful.

@uranusjr uranusjr removed the S: needs triage Issues/PRs that need to be triaged label Aug 7, 2021
@uranusjr uranusjr added this to the 21.2.4 milestone Aug 7, 2021
@r-apabbathi
Copy link

@uranusjr Is this issue resolved? I still see this error

@DiddiLeija
Copy link
Member

Well, @uranusjr moved the issue to the 21.2.4 milestone, so I think the change hasn't been released yet (the latest release is 21.2.3). Maybe a future release will include these changes.

@uranusjr
Copy link
Member

Correct, this has not been released. I plan to do 21.2.4 this weekend. The report was unfortunately a few hours too late, otherwise I would’ve fixed this first before releasing 21.2.3.

inmantaci pushed a commit to inmanta/inmanta-core that referenced this issue Aug 12, 2021
Bumps [pip](https://github.com/pypa/pip) from 21.2.3 to 21.2.4.
<details>
<summary>Changelog</summary>
<p><em>Sourced from <a href="https://github.com/pypa/pip/blob/main/NEWS.rst">pip's changelog</a>.</em></p>
<blockquote>
<h1>21.2.4 (2021-08-12)</h1>
<h2>Bug Fixes</h2>
<ul>
<li>Fix 3.6.0 compatibility in link comparison logic. (<code>[#10280](pypa/pip#10280) &lt;https://github.com/pypa/pip/issues/10280&gt;</code>_)</li>
</ul>
</blockquote>
</details>
<details>
<summary>Commits</summary>
<ul>
<li>See full diff in <a href="https://github.com/pypa/pip/commits">compare view</a></li>
</ul>
</details>
<br />

[![Dependabot compatibility score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=pip&package-manager=pip&previous-version=21.2.3&new-version=21.2.4)](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores)

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`.

[//]: # (dependabot-automerge-start)
[//]: # (dependabot-automerge-end)

---

<details>
<summary>Dependabot commands and options</summary>
<br />

You can trigger Dependabot actions by commenting on this PR:
- `@dependabot rebase` will rebase this PR
- `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it
- `@dependabot merge` will merge this PR after your CI passes on it
- `@dependabot squash and merge` will squash and merge this PR after your CI passes on it
- `@dependabot cancel merge` will cancel a previously requested merge and block automerging
- `@dependabot reopen` will reopen this PR if it is closed
- `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
- `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
- `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)

</details>
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Sep 24, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants