为什么 pip3 在 Ubuntu 20.04 上安装/更新软件包后要创建 kdewallet?

Ges*_*ter 15 sudo kde pip python-3.x ubuntu-20.04

我最近将我的系统从 Ubuntu 18.04 更新到 20.04。之后,我尝试使用此处提到的 shell 命令更新我所有的 pip3 包(我将“pip”更改为“pip3”)。

在更新了几个包后,出现了这个提示: KDE Wallet Service

由于我在更新/安装软件包时从未见过它,因此我取消了它,导致立即重新打开相同的提示,并且终端显示以下警告:

WARNING: Keyring is skipped due to an exception: Failed to unlock the keyring!
Run Code Online (Sandbox Code Playgroud)

在它尝试安装的下一个包发生同样的情况后,我按下了 CTRL+C。从那时起,当我尝试安装软件包时,也会发生同样的情况。

例子:

pip3 install numpy
WARNING: Keyring is skipped due to an exception: Failed to unlock the keyring!
WARNING: Keyring is skipped due to an exception: Failed to unlock the keyring!
Collecting numpy
  WARNING: Keyring is skipped due to an exception: Failed to unlock the keyring!
  Using cached numpy-1.19.2-cp38-cp38-manylinux2010_x86_64.whl (14.5 MB)
Installing collected packages: numpy
  WARNING: The scripts f2py, f2py3 and f2py3.8 are installed in '/home/gesuchter/.local/bin' which is not on PATH.
  Consider adding this directory to PATH or, if you prefer to suppress this warning, use --no-warn-script-location.
Successfully installed numpy-1.19.2
Run Code Online (Sandbox Code Playgroud)

我已经尝试通过重新安装 python3-pip 来解决我的问题。

以下是一些有用的信息:

pip3 --version
pip 20.0.2 from /usr/lib/python3/dist-packages/pip (python 3.8)

ls ~/.local/share/keyrings
default  login.keyring  user.keystore

find ~/.config/kwalletrc
find: ‘/home/gesuchter/.config/kwalletrc’: No such file or directory
Run Code Online (Sandbox Code Playgroud)

Wis*_*ind 8

此问题已在上游报告,请参阅https://github.com/pypa/pip/issues/8090以及该线程链接的其他问题。

tl;dr:新版本的 pip 过于急切地在密钥环中搜索访问某些软件包下载可能需要的凭据。如果它最终查询尚不存在的密钥环(例如 kdewallet),则会出现您注意到的提示。目前尚不清楚这个问题将如何以及在哪个版本中得到完全修复。

编辑:请注意,stackoverflow 不是错误报告的正确位置:pip 维护者不太可能看到这一点,而且据我所知,它也不在 stackoverflow 的范围内。这可能是另一个 stackexchange 社区(也许是超级用户?)的问题。但由于您已经确定这是 pip 的问题,因此报告的最佳位置是https://github.com/pypa/pip上的自述文件中指出的任何沟通渠道

  • 这些天PIp一团糟。在这与点子警告之间是一段艰难的时期。 (3认同)

Cir*_*四事件 6

这为我解决了:

python3 -m keyring --disable
Run Code Online (Sandbox Code Playgroud)

运行它添加:

[backend]
default-keyring=keyring.backends.null.Keyring
Run Code Online (Sandbox Code Playgroud)

到文件~/.config/python_keyring/keyringrc.cfg

大概PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring /sf/answers/4795289621/ 中提到提供了一种环境变量方式来实现相同的结果。

如果没有这个,它会在我每次尝试安装软件包时显示烦人的 KDE 密钥环弹出窗口:

在此处输入图片说明

谷歌,索引这个:

KDE 钱包系统

应用程序“/usr/lib/python3/dist-packages/pip/ main .py”请求创建一个名为“kdewallet”的新钱包。这用于以安全的方式存储敏感数据。请在下方选择新钱包的类型或单击取消以拒绝应用程序的请求。

  • 经典,河豚加密文件
  • 使用 GPG 加密,以获得更好的保护

相关:https : //askubuntu.com/questions/1205161/annoying-kde-wallet-service-popup-the-application-kded5-has-requested-to-open

在 Ubuntu 21.04、Python 3.9.5、pip3 20.3.4、keyring==22.2.0 上测试。