在python中导入密钥环库时出错

胡安·阿尔塔加(Juan Arteaga)

导入密钥环库时,我总是收到相同的错误。仅在代码中添加“导入密钥环”会导致出现此错误。我尝试再次安装该库,但并没有解决。

我在pythonanywhere中使用python 3.5。

有人可以帮助我弄清楚可能会发生什么,还是我可以尝试做些什么来解决它?

这是错误消息。

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'
>>>

预先感谢您提供的任何帮助。

hwjp

我的猜测是,系统安装的模块之一与您安装pip install --user〜/ .local的模块之间存在某种冲突。

我建议切换到virtualenv以获得一组“干净”的模块/依赖项。此处提供更多信息:https : //help.pythonanywhere.com/pages/Virtualenvs

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章