我最近把我的系统从Ubuntu18.04升级到了20.04.之后,我try 使用shell命令here更新我的所有pip3包(我将"pip"改为"pip3").

在更新了几个软件包后,出现了以下提示:

因为我在更新/安装软件包时从未见过它,所以我取消了它,导致同一提示符立即重新打开,终端显示以下警告:

WARNING: Keyring is skipped due to an exception: Failed to unlock the keyring!

我按下CTRL+C键,它试图安装的下一个软件包也发生了同样的情况.自从我try 安装软件包后,同样的情况也发生了.

例子:

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

我已经try 通过重新安装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

推荐答案

这为我解决了问题:

python3 -m keyring --disable

运行它会增加:

[backend]
default-keyring=keyring.backends.null.Keyring

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

据推测,https://stackoverflow.com/a/68504137/895245中提到的PYTHON_KEYRING_BACKEND=keyring.backends.null.Keyring 提供了一种环境变量方法来实现相同的结果.

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

enter image description here

谷歌,索引如下:

KDE钱包系统

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

  • classic 的河豚加密文件
  • 使用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上测试.

Python-3.x相关问答推荐

如何在输入正确的用户名和密码时添加按钮?

正确的本地react 方式-Django身份验证

从.csv导入将文件夹路径加入到文件名

无法使用xpath关闭selenium中的弹出窗口

使用 iloc 或 loc 对多列进行过滤

数据框中从每个组/ID的底部删除行

提取图像中的背景并保存

使用 NaN 计算 pct_change 时如何避免 bfill 或 ffill

如何使用 Selenium 和 Python 作为线程来使用事件(Chrome-Developer-Tools)?

为什么 mypy 不适用于 sqlalchemy?

如果网站加载时间过长,如何强制 Selenium 刷新

魔术8球txt文件列表

Pandas 将列格式化为货币

无法在 Windows Python 3.5 上安装 Levenshtein 距离包

Python 3.9.8 使用 Black 并导入 `typed_ast.ast3` 失败

如何使用 asyncio 添加连接超时?

为什么 string.maketrans 在 Python 3.1 中不起作用?

Pruning in Keras

如何判断列表中的所有项目是否都是字符串

在动态链接库 Anaconda3\Library\bin\mkl_intel_thread.dll 中找不到序数 242