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:
- Create a new account
- Upload the package with the new account with
twine upload dist/* - 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/