pythonpyinstallerpython-keyring

RuntimeError: No recommended backend was available. (Keyring w/ Python)


I have a program which uses Yagmail and the keyring package to safley store email credentials. When I run this script in atom.io and idle it works.

However, after I packaged it with pyinstaller it is giving me this message:

RuntimeError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details.

In my program I have

import keyring

I also have gone and installed keyring.alt


Solution

  • Since i cant add comments, i am adding my inputs in answer block. hope this helps.

    I also had similar issue, where i used a keyring module to store passwordin my python script and packaged it using pyinstaller. My script ran perfect when i run it directly. But when i try to run the python exe , i got same error as below

    "RuntimeError: No recommended backend was available. Install a recommended 3rd party backend package; or, install the keyrings.alt package if you want to use the non-recommended backends. See https://pypi.org/project/keyring for details."

    I googled about this error and found below link (this may not be directly related but there someone gave a workaround). I added the workaround as suggested in the link (you have get which keyring backend you are using as well) and it worked.

    Link: https://github.com/jaraco/keyring/issues/359 Code to find which keyring backend you are using

    from keyring import get_keyring
    get_keyring()
    

    As suggested in the above like you can add the block somewhere in your script and then exe file will run perfectly.