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 installs latest keyring but requires incompatible importlib-metadata

See original GitHub issue
  • I am on the latest Poetry version.

  • I have searched the issues of this repo and believe that this is not a duplicate.

  • If an exception occurs when executing a command, I executed it again in debug mode (-vvv option).

  • OS version and name: CircleCI docker image: cimg/python:3.7.10

  • Poetry version: 1.1.13

  • Python version: 3.7.10

Issue

Immediately after installing the latest version of poetry (1.1.13) via pip (i.e., pip install -U poetry), a call to poetry config http-basic.myrepository $USERNAME $PASSWORD fails with the following:

  TypeError

  entry_points() got an unexpected keyword argument 'group'

  at ~/.pyenv/versions/3.7.10/lib/python3.7/site-packages/keyring/backend.py:196 in _load_plugins
      192│     of the plugin at initialization time.
      193│ 
      194│     `initialize_func` is optional, but will be invoked if callable.
      195│     """
    → 196│     for ep in metadata.entry_points(group='keyring.backends'):
      197│         try:
      198│             log.debug('Loading %s', ep.name)
      199│             init_func = ep.load()
      200│             if callable(init_func):

Exited with code exit status 1

Upon investigation, I noticed this new complaint from pip during installation:

ERROR: keyring 23.5.0 has requirement importlib-metadata>=3.6, but you'll have importlib-metadata 1.7.0 which is incompatible.

That appears to be a consequence of the change, introduced in poetry 1.1.13, allowing the most recent version of keyring. In pyproject.toml for poetry itself, I see this for v1.1.13:

keyring = [
    { version = "^18.0.1", python = "~2.7" },
    { version = "^20.0.1", python = "~3.5" },
    { version = ">=21.2.0", python = "^3.6" }
]

and this for 1.1.12:

keyring = [
    { version = "^18.0.1", python = "~2.7" },
    { version = "^20.0.1", python = "~3.5" },
    { version = "^21.2.0", python = "^3.6" }
]

(note the change from caret to >=)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:6 (3 by maintainers)

github_iconTop GitHub Comments

3reactions
lucidyancommented, Jun 5, 2022

TL;DR solution for those who stuck in the same problem

python -m pip install --upgrade pip
3reactions
finswimmercommented, Feb 25, 2022

Hey,

I’m closing this because it’s not a Poetry issue. pip seems to wrongly resolve the dependencies here. However we will change the version constraint of importlib-metadata to >=1.6.0 because there is no reason to restrict it more tight.

fin swimmer

Read more comments on GitHub >

github_iconTop Results From Across the Web

poetry-windows-fix - Python Package Health Analysis | Snyk
A security vulnerability was detected in an indirect dependency that is added to your project when the latest version of poetry-windows-fix is installed....
Read more >
Conda Pip and All That - Washington State University
This will create a local virtual environment in .venv in which any new packages will be installed, but which will still have access...
Read more >
Using importlib.metadata — Python 3.11.1 documentation
importlib_metadata is a library that provides access to the metadata of an installed Distribution Package, such as its entry points or its top-level...
Read more >
prediction using LAMA | Kaggle
but you have torch 1.8.1 which is incompatible. markdown 3.3.7 ... which is incompatible. keyring 23.6.0 requires importlib-metadata>=3.6; ...
Read more >
importerror: cannot import name 'main' from 'poetry.console'
To recover the pip3 binary you'll need to sudo python3 -m pip uninstall pip && sudo apt install python3-pip --reinstall .
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