GustavoKatel / pushbullet-cli

Access Pushbullet from the command line
MIT License
282 stars 31 forks source link

AttributeError: module 'keyrings.alt' has no attribute 'file' #99

Closed elig0n closed 3 years ago

elig0n commented 3 years ago
Traceback (most recent call last):
  File "/usr/bin/pb", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.9/site-packages/click/core.py", line 829, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 782, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1256, in invoke
    Command.invoke(self, ctx)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 1066, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.9/site-packages/click/core.py", line 610, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.9/site-packages/pushbullet_cli/app.py", line 94, in main
    if isinstance(keyring.get_keyring(), keyrings.alt.file.EncryptedKeyring):
AttributeError: module 'keyrings.alt' has no attribute 'file'

I found that pb app.py has to explicitly import keyrings.alt.file because neither keyrings.alt nor keyrings.alt.file would be accessible if it simply import keyrings alone.

ReneFroger commented 3 years ago

I have the same problem with the keyrings.alt in installation, since Pip can't find the right version.

GustavoKatel commented 3 years ago

hi @elig0n can u try installing from the main branch and see if you still have issues with that?

elig0n commented 3 years ago

you mean from git or via pip upgrade?

GustavoKatel commented 3 years ago

git please

  1. git clone
  2. create a virtualenv to not mess with your current installation
  3. pip install .
  4. try running and see if the error persists
GustavoKatel commented 3 years ago

@ReneFroger @elig0n could try v1.2.1? just pushed to pypi. Feel free to reopen this issue if the problem is still happening

elig0n commented 3 years ago

@GustavoKatel seems to work without problems after upgrade to 1.2.1

elig0n commented 2 years ago

This issue seems to have returned in version 0.7.5 / 1.2.2 (using Python 3.10) I have managed to workaround it by manually import every object:

from keyrings.alt.file import EncryptedKeyring, PlaintextKeyring

and then specifically referring to these objects later in the file.

But then when I try to push something I get:

Traceback (most recent call last):
  File "/home/user/.local/bin/pb", line 8, in <module>
    sys.exit(main())
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
TypeError: push() got an unexpected keyword argument 'file'                               /0.2s

Click version: 8.1.3