question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Poetry 1.1.11 | AttributeError 'Link' object has no attribute 'name'

See original GitHub issue

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.

Stack Overflow post

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:15 (1 by maintainers)

github_iconTop GitHub Comments

4reactions
mikkelamcommented, Nov 23, 2021

I was struggling with the same as OP and I figured out that the hashes were cached so i deleted /.cache/pypoetry/ along with my poetry.lock and then it worked. EDIT: this was debian

1reaction
rachmadaniHaryonocommented, Nov 22, 2021

https://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


  • OS version and name: ubuntu 21.10
  • Poetry version: 1.1.11
  • Link of a Gist with the contents of your pyproject.toml file:
  1. create empty project with poetry
pyproject.toml

[tool.poetry]
name = "temp"
version = "0.1.0"
description = ""
authors = ["author <me@gmail.com>"]

[tool.poetry.dependencies]
python = "^3.9"

[tool.poetry.dev-dependencies]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

  1. poetry add flask-admin
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.

3. i try to uninstall with get-poetry --uninstall
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

4. but after i check poetry command, it is still installed so i just remove symbolic link
$ 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
  1. reinstall as suggested above

  2. when i try poetry add flask-admin, the same error on 2 happen again


temporary 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

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 temporary solution 1 for flask-admin


there 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 RuntimeError

Read more comments on GitHub >

github_iconTop Results From Across the Web

Poetry | AttributeError 'Link' object has no attribute 'name'
The error seems to suggest that you poetry.lock file is out of synch with you pyproject.toml. Usually just deleting the poetry.lock file and ......
Read more >
Dependency Management With Python Poetry
Learn how Python Poetry will help you start new projects, maintain existing ones, and master dependency management.
Read more >
Python projects documentation | k8saas documentation
Poetry install error with 'Link' object has no attribute 'is_absolute'​. Error messages: • Installing urllib3 (1.26.7): Failed
Read more >
History | Poetry - Python dependency management and ...
Fix an issue where no cache entry is found when calling poetry cache clear with a non-normalized package name (#6537). Fix an invalid...
Read more >
pyparsing | Python library for creating PEG parsers | Parser library
How to scrape two tables with same classname? · PIP failed to build package cytoolz · Poetry | AttributeError 'Link' object has no...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found