Tim U
Tim U

Reputation: 123

Pip throws 'Error initializing plugin EntryPoint(name='macOS', value='keyring.backends.macOS', group='keyring.backends')'

I'm running python 3.8 under Pop!_OS and noticed a weird reoccurring error when running various pip commands like install or list --outdated. The full error states:

Error initializing plugin EntryPoint(name='macOS', value='keyring.backends.macOS', group='keyring.backends').
Traceback (most recent call last):
  File "/usr/lib/python3/dist-packages/keyring/backend.py", line 203, in _load_plugins
    init_func = ep.load()
  File "/usr/lib/python3.8/importlib/metadata.py", line 77, in load
    module = import_module(match.group('module'))
  File "/usr/lib/python3.8/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1014, in _gcd_import
  File "<frozen importlib._bootstrap>", line 991, in _find_and_load
  File "<frozen importlib._bootstrap>", line 973, in _find_and_load_unlocked
ModuleNotFoundError: No module named 'keyring.backends.macOS'

The command's functionality appears to be unaffected by this but it irritates me nonetheless and I have been unable to find anything about this sort of error. So my question is, why is this error triggered by various basic pip commands, why is it about macOS and how do I fix it?

Upvotes: 8

Views: 4399

Answers (4)

svaponi
svaponi

Reputation: 1026

Just run:

python -m keyring --disable

This should fix (or create if missing) the file $HOME/.config/python_keyring/keyringrc.cfg (use python -c "import keyring.util.platform_; print(keyring.util.platform_.config_root()); to check what's the right path for you).

Upvotes: 0

JP Mercier
JP Mercier

Reputation: 377

I solved the issue by reinstalling the python keyring package

pip uninstall keyring
pip install keyring

Updating the package may also work

pip install keyring -U

Upvotes: 2

eyal RnD
eyal RnD

Reputation: 45

For me, it happened because I conda activate my env from an existing env.

This raised the error

$ conda activate my_env1
(my_env1) $ conda activate my_env2
(my_env2) $ pip install <package>

And this fixed it

$ conda activate my_env1
(my_env1) $ conda deactivate
$ conda activate my_env2
(my_env2) $ pip install <package>

Upvotes: 0

doidoooooo
doidoooooo

Reputation: 34

That was happening to me also after trying to update keyring. I properly updated it afterwards and it persisted. My issue solved itself after I opened a new terminal window....

Upvotes: 1

Related Questions