Twine upload TypeError: expected string or bytes-like object

不问归期 提交于 2019-12-23 06:57:16

问题


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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!