问题
Has anybody got an error like this when you try to upload your package ?
$ 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
Edit: Got the same error again but this time to fix it I upgraded twine and it started working again.
回答1:
Updating twine solved the problem for me. For this, execute the following command before doing twine upload dist/*
:
python3 -m pip install --user --upgrade twine
回答2:
I had the same problem after installing twine by apt
. It seems that it installed twine for python2 and my project was python3.
So I've installed twine with pip for python3:
pip3 install twine
and used the following command:
python3 -m twine upload dist/*
Worked perfectly fine
来源:https://stackoverflow.com/questions/49806586/twine-upload-typeerror-expected-string-or-bytes-like-object