-
Notifications
You must be signed in to change notification settings - Fork 2.3k
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
Poetry 1.1.11 | AttributeError 'Link' object has no attribute 'name' #4701
Comments
Possibly a duplicate of #4688. I guess that to check if it is fixed, you need to either bump |
What python are you trying to install this for? Pathlib is inbuilt into Python since 3.4 |
I attempted to update, but it errors:
How else can I update to the latest version? |
Python 3.8.10 |
Update: I have been able to somewhat solve part of the problem. Had to re-install Poetry... the proper way, as solved here. However, now I am getting a new issue, again consistent with all package that won't install: Latest terminal output in top post^ I've made a Stack Overflow regarding this here. I'm still keeping this thread active, as this exact series of problems may very well occur for others. |
Unable to find installation candidates for
all packages.
Only one instance of the error left. Deleted the |
I was able to get |
Looks like this should be → 632│ archive.name, Though, looks like in current source those lines were refactored a bit since the most recent pypi release (but still has the poetry/poetry/installation/executor.py Lines 681 to 686 in 5dcf24d
So that should cover the first error, but not underlying cause of where poetry isn't matching proper hashes sometimes. |
@mattsta Would it be safe to replace those lines numbers with the code you've pasted in |
I was struggling with the same as OP and I figured out that the hashes were cached so i deleted |
Removing |
I was able to solve this Issue too, as well as other Poetry problems as detailed here! TL;DR - |
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
[tool.poetry]
name = "temp"
version = "0.1.0"
description = ""
authors = ["author <[email protected]>"]
[tool.poetry.dependencies]
python = "^3.9"
[tool.poetry.dev-dependencies]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
error
$ poetry add flask-admin
Using version ^1.5.8 for Flask-Admin
Updating dependencies
Resolving dependencies... (0.8s)
Package operations: 1 install, 0 updates, 0 removals
• Installing flask-admin (1.5.8): Failed
AttributeError
'Link' object has no attribute 'name'
at ~/.local/share/pypoetry/venv/lib/python3.9/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│
Failed to add packages, reverting the pyproject.toml file to its original content. uninstall
$ python3 get-poetry.py --uninstall
# We are sorry to see you go!
This will uninstall Poetry.
It will remove the `poetry` command from Poetry's bin directory, located at:
$HOME/.poetry/bin
This will also remove Poetry from your system's PATH.
Are you sure you want to uninstall Poetry? (y/[n]) y $ which poetry
/home/r3r/.local/bin/poetry
$ ll ~/.local/bin/poetry
lrwxrwxrwx 1 r3r r3r 47 Nov 7 12:26 /home/r3r/.local/bin/poetry -> /home/r3r/.local/share/pypoetry/venv/bin/poetry
$ rm ~/.local/bin/poetry
rm: remove symbolic link '/home/r3r/.local/bin/poetry'? y
$ poetry --version
poetry: command not found
temporary solution 1 : but flask-admin have to be installed everytime you run temporary solution 2: edit executor.py on my case it is on so i edit based on this comment #4701 (comment) archive.name if hasattr(archive, 'name') else archive.filename, this is little bit different with recent poetry code but i got another error $ poetry add flask-admin
Using version ^1.5.8 for Flask-Admin
Updating dependencies
Resolving dependencies... (0.1s)
Package operations: 1 install, 0 updates, 0 removals
• Installing flask-admin (1.5.8): Failed
RuntimeError
Invalid hashes (sha256:e7e11ee8bf67ad176dd1224c137e860f5d387357d7331fc650f0a9eef03cdc83) for flask-admin (1.5.8) using archive Flask-Admin-1.5.8.tar.gz. Expected one of sha256:eb06a1f31b98881dee53a55c64faebd1990d6aac38826364b280df0b2679ff74.
at ~/.poetry/lib/poetry/installation/executor.py:628 in _download_link
624│ )
625│ )
626│
627│ if archive_hashes.isdisjoint(hashes):
→ 628│ raise RuntimeError(
629│ "Invalid hashes ({}) for {} using archive {}. Expected one of {}.".format(
630│ ", ".join(sorted(archive_hashes)),
631│ package,
632│ archive.name if hasattr(archive, 'name') else archive.filename,
Failed to add packages, reverting the pyproject.toml file to its original content. 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 there is some solution for this issue here #4085, but i can't find which one fit for me yet without using |
@rachmadaniHaryono Whenever I next have an |
after update to version 1.1.12 i can confirm that i can get actual error just like my last post without modifying executor.py $ poetry add flask-admin
Using version ^1.5.8 for Flask-Admin
Updating dependencies
Resolving dependencies... (5.7s)
Writing lock file
Package operations: 8 installs, 0 updates, 0 removals
• Installing markupsafe (2.0.1)
• Installing click (8.0.3)
• Installing itsdangerous (2.0.1)
• Installing jinja2 (3.0.3)
• Installing werkzeug (2.0.2)
• Installing flask (2.0.2)
• Installing wtforms (3.0.0)
• Installing flask-admin (1.5.8): Failed
RuntimeError
Invalid hashes (sha256:e7e11ee8bf67ad176dd1224c137e860f5d387357d7331fc650f0a9eef03cdc83) for flask-admin (1.5.8) using archive Flask-Admin-1.5.8.tar.gz. Expected one of sha256:eb06a1f31b98881dee53a55c64faebd1990d6aac38826364b280df0b2679ff74.
at ~/.poetry/lib/poetry/installation/executor.py:627 in _download_link
623│ )
624│ )
625│
626│ if archive_hashes.isdisjoint(hashes):
→ 627│ raise RuntimeError(
628│ "Invalid hashes ({}) for {} using archive {}. Expected one of {}.".format(
629│ ", ".join(sorted(archive_hashes)),
630│ package,
631│ archive_path.name,
Failed to add packages, reverting the pyproject.toml file to its original content. this seems fixed on #4549 |
This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Specification:
Terminal |
poetry install
(Updated):Please let me know if there is anything else I can add to post.
Stack Overflow post
The text was updated successfully, but these errors were encountered: