poetry: Poetry 1.1.11 | AttributeError 'Link' object has no attribute 'name'
Specification:
- Windows 10,
- Visual Studio Code,
- Python 3.8.10 & Poetry 1.1.11,
- Ubuntu Bash.
Terminal | poetry install
(Updated):
me@PF2DCSXD:/mnt/c/Users/user/Documents/GitHub/workers-python/workers/composite_key$ poetry install
Updating dependencies
Resolving dependencies... (464.3s)
Writing lock file
Package operations: 55 installs, 11 updates, 0 removals
• Updating pyparsing (3.0.4 -> 2.4.7)
• Updating pyyaml (5.4.1 -> 6.0)
• Updating soupsieve (2.2.1 -> 2.3)
• Installing arrow (1.2.1)
• Updating botocore (1.22.8 -> 1.22.10)
• Installing chardet (4.0.0)
• Updating itsdangerous (1.1.0 -> 2.0.1)
• Updating jinja2 (2.11.3 -> 3.0.2)
• Updating packaging (20.9 -> 21.2)
• Installing text-unidecode (1.3)
• Updating werkzeug (1.0.1 -> 2.0.2)
• Installing binaryornot (0.4.4)
• Installing bokeh (2.4.1): Failed
AttributeError
'Link' object has no attribute 'name'
at ~/.local/share/pypoetry/venv/lib/python3.8/site-packages/poetry/installation/executor.py:632 in _download_link
628│ raise RuntimeError(
629│ "Invalid hashes ({}) for {} using archive {}. Expected one of {}.".format(
630│ ", ".join(sorted(archive_hashes)),
631│ package,
→ 632│ archive.name,
633│ ", ".join(sorted(hashes)),
634│ )
635│ )
636│
• Updating configparser (5.0.2 -> 5.1.0)
• Updating flask (1.1.4 -> 2.0.2)
• Installing jinja2-time (0.2.0)
• Installing poyo (0.5.0)
• Installing python-slugify (5.0.2)
Please let me know if there is anything else I can add to post.
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 16 (1 by maintainers)
Commits related to this issue
- chore: lock mkdocs-material version to mitigate https://github.com/python-poetry/poetry/issues/4701 — committed to adriangb/di by adriangb 3 years ago
I was struggling with the same as OP and I figured out that the hashes were cached so i deleted
/.cache/pypoetry/
along with mypoetry.lock
and then it worked. EDIT: this was debianhttps://github.com/python-poetry/poetry/issues/4701#issuecomment-970423634
above solution don’t work for me
the op of this thread found the error when installing bokeh and possibly other package as well, but i can recreate it from empty project
pyproject.toml
poetry add flask-admin
error
uninstall
reinstall as suggested above
when i try
poetry add flask-admin
, the same error on 2 happen againtemporary solution 1 :
poetry run pip install flask-admin
but flask-admin have to be installed everytime you run
poetry install
temporary solution 2: edit executor.py
on my case it is on
~/.local/share/pypoetry/venv/lib/python3.9/site-packages/poetry/installation/executor.py
so i edit based on this comment https://github.com/python-poetry/poetry/issues/4701#issuecomment-963712002
this is little bit different with recent poetry code
but i got another error
this is another error not related to this issue, but i still can’t find if there is issue similar to this
so in the end i use
temporary solution 1
for flask-adminthere is some solution for this issue here https://github.com/python-poetry/poetry/issues/4085, but i can’t find which one fit for me yet without using
temporary solution 2
to get RuntimeErrorLooks like this should be
archive.filename
instead becausearchive
is aLink
andLink
has.filename
but no.name
:Though, looks like in current source those lines were refactored a bit since the most recent pypi release (but still has the
archive.name
bug): https://github.com/python-poetry/poetry/blob/5dcf24da04275425631c817419ad5cb17cbd0177/poetry/installation/executor.py#L681-L686So that should cover the first error, but not underlying cause of where poetry isn’t matching proper hashes sometimes.
Only one instance of the error left. Deleted the
poetry.lock
file and ranpoetry install
again.What python are you trying to install this for? Pathlib is inbuilt into Python since 3.4