Twine upload TypeError: expected string or bytes-like object

Twine upload TypeError: expected string or bytes-like object

有没有人在尝试上传包时遇到这样的错误?

   $ twine upload dist/*
   Uploading distributions to https://upload.pypi.org/legacy/
   Enter your username: MyUsername
   Enter your password: ********
   TypeError: expected string or bytes-like object

编辑:再次遇到同样的错误,但这次为了修复它,我升级了 twine,它又开始工作了。

更新 twine 解决了我的问题。为此,在执行 twine upload dist/*:

之前执行以下命令

python3 -m pip install --user --upgrade twine

我在 apt 安装 twine 后遇到了同样的问题。它似乎为 python2 安装了 twine 而我的项目是 python3.

所以我已经为 python3:

安装了带 pip 的 twine
pip3 install twine

并使用了以下命令:

python3 -m twine upload dist/*

工作得很好