3

I keep getting the same error when I import the keyring library. Just adding 'import keyring' to the code causes this error to appear. I have tried installing the library again, but that didn't solve it.

I'm using python 3.5 in pythonanywhere.

Can somebody help me figure out what might be going on or what I else I can try to do to fix it?

This is the Error message.

Traceback (most recent call last): 
File "/home/Marketscale/Tests/OAuth Test.py", line 3, in <module> import keyring 
File "<frozen importlib._bootstrap>", line 969, in _find_and_load 
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked 
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked 
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible 
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/__init__.py", line 6, in <module> 
File "<frozen importlib._bootstrap>", line 969, in _find_and_load 
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked 
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked 
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible 
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/core.py", line 149, in <module> 
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/core.py", line 65, in init_backend 
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/util/__init__.py", line 20, in wrapper 
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/backend.py", line 179, in get_all_keyring 
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/backend.py", line 139, in _load_backends 
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/backend.py", line 131, in _load_backend 
File "/usr/lib/python3.5/importlib/__init__.py", line 126, in import_module return _bootstrap._gcd_import(name[level:], package, level) 
File "<frozen importlib._bootstrap>", line 986, in _gcd_import 
File "<frozen importlib._bootstrap>", line 969, in _find_and_load 
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked 
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked 
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible 
File "/home/Marketscale/.local/lib/python3.5/site-packages/keyring-10.3.2-py3.5.egg/keyring/backends/SecretService.py", line 9, in <module> 
File "<frozen importlib._bootstrap>", line 969, in _find_and_load 
File "<frozen importlib._bootstrap>", line 958, in _find_and_load_unlocked 
File "<frozen importlib._bootstrap>", line 664, in _load_unlocked 
File "<frozen importlib._bootstrap>", line 634, in _load_backward_compatible 
File "/home/Marketscale/.local/lib/python3.5/site-packages/SecretStorage-2.3.1-py3.5.egg/secretstorage/__init__.py", line 13, in <module> 
File "/usr/lib/python3/dist-packages/dbus/__init__.py", line 81, in <module> import dbus.exceptions as exceptions 
AttributeError: module 'dbus' has no attribute 'exceptions'
>>>

Thank you in advance for any help you can provide.

2
  • Looks like you need to post the code that's calling for the attribute 'exceptions' Commented Apr 19, 2017 at 15:22
  • That's the thing, I don't call anything. The error comes just from 'import keyring'. I have tested that. I made a short code that works, but just adding 'import keyring' to it, without using the library at all causes the error to appear. Commented Apr 19, 2017 at 15:51

1 Answer 1

2

My guess is that there's some kind of conflict between one of the system-installed modules and the ones you've installed with pip install --user into ~/.local

I suggest switching to a virtualenv to get a "clean" set of modules/dependencies. More info here: https://help.pythonanywhere.com/pages/Virtualenvs

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks, that helped.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.