I have a package that I would like to upload with a token from my PyPI account, but when I do it returns this:
C:/desktop/Module>>> twine upload dist/*
Uploading distributions to https://upload.pypi.org/legacy/
Enter your username: __token__
Enter your password:
WARNING Your password contains control characters. Did you enter it correctly?
WARNING See https://twine.readthedocs.io/#entering-credentials for more information.
Uploading Module-2.1.1-py3-none-any.whl
100% ---------------------------------------- 6.4/6.4 kB • 00:01 • ?
WARNING Error during upload. Retry with the --verbose option for more details.
ERROR HTTPError: 403 Forbidden from https://upload.pypi.org/legacy/
Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more
information.
When I created the token I copied and pasted it in so I know that the problem is not that I have typed it in incorrectly. Does anyone know why this is?
Did you open the suggested URL for more information? There, you’ll find:
If you’re using Windows and trying to paste your username, password, or token in the Command Prompt or PowerShell, 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.
Thanks for that, that is will be why it is not working. However my Command Prompt does not have any menus up the top. Will there be another way to do this?
Hmm, I hadn’t noticed, but in the latest version of Windows 11, the CMD window that those instructions refer to is now gone, and in its place the Windows Terminal app (now called just Terminal) opens instead no matter how you launch the Command Prompt.
I don’t use Windows regularly, but back when I was trouble-shooting the above issue, I think I tried the new Windows Terminal, and didn’t experience this issue.