gpt4 book ai didi

python - 在python中导入 key 环库时出错

转载 作者:行者123 更新时间:2023-11-28 17:17:16 25 4
gpt4 key购买 nike

当我导入 key 环库时,我总是遇到同样的错误。只需将“导入 key 环”添加到代码中就会导致出现此错误。我已经尝试再次安装该库,但并没有解决问题。

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

提前感谢您提供的任何帮助。

最佳答案

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

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

关于python - 在python中导入 key 环库时出错,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43499800/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com