Can't upload to PyPi with Twine

后端 未结 7 1183
自闭症患者
自闭症患者 2021-01-11 12:58

I\'m trying to upload a python package to PyPi, using the following commands:

pip install -e .
python setup.py bdist_wheel --universal
twine upload --reposit         


        
相关标签:
7条回答
  • 2021-01-11 13:06

    An alternative could have been that copying and pasting wasn't working - when I try to paste the password in the command line it showed this error, but when I typed it out manually it succeeded.

    EDIT: it looks like this is a known issue with pasting on Windows, see suggestion on https://pypi.org/help/#invalid-auth:

    If you're using Windows and trying to paste your password or token in the Command Prompt or PowerShell, note that Ctrl-V and Shift+Insert won't work. Instead, you can use "Edit > Paste" from the window menu, or enable "Use Ctrl+Shift+C/V as Copy/Paste" in "Properties". This is a known issue with Python's getpass module.

    0 讨论(0)
  • 2021-01-11 13:07

    PyPi and TestPyPi are separate instances of the package index which have separate user databases. Therefore, separate accounts must be created.

    Maybe you'll get lucky and the test account name won't be taken and you can use the same commands in test as in production.

    (Grumble, grumble, zen of python, grumble....)

    0 讨论(0)
  • 2021-01-11 13:11

    EDIT: if you're using Windows, check my other suggestion

    It looks like some sort of error with the account I was using. The following steps fixed it for me:

    1. Create a new account
    2. Upload the package with the new account with twine upload dist/*
    3. Add the previous account (that you originally wanted to upload with) to the package as an owner

    Also be aware that the test pypi server --repository-url https://test.pypi.org/legacy/, requires a different account to be created from the live server --repository-url https://upload.pypi.org/legacy/

    0 讨论(0)
  • 2021-01-11 13:12

    When we enter the password, the password is not wrong, and I think it's a bug.

    I use -u for the username and -p for the password directly without using the fields provided by the console(the default).

    I try to run this in the command: twine upload -u YOUR-USERNAME -p YOUR-PASSWORD - repository-url https://test.pypi.org/legacy/ dist / *

    I run that command on windows

    It works for me. Hope this will help

    0 讨论(0)
  • 2021-01-11 13:12

    Type in the password manually. Seems dumb but it worked for me.

    0 讨论(0)
  • 2021-01-11 13:15

    I hit this problem following the pypi instructions for creating a new package. That tutorial takes you through uploading to their test server (--repository-url https://test.pypi.org/legacy/), for which I always get a 403.

    For their actual uploads server, (--repository-url https://upload.pypi.org/legacy/) my credentials work fine. So clearly there's some variation in credentials between their test and live servers, which could be worth considering if you're bumping against this problem.

    0 讨论(0)
提交回复
热议问题