Poetry publish HTTP Error 403: Invalid or non-existent authentication information beheben

Problem:

Wenn du poetry publish ausführst, erhältst du eine Fehlermeldung wie diese:

poetry_publish_403_error_output.txt
Publishing UliEngineering (0.4.19) to PyPI
 - Uploading uliengineering-0.4.19-py3-none-any.whl FAILED

HTTP Error 403: Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information. | b'<html>\n <head>\n  <title>403 Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information.\n \n <body>\n  <h1>403 Invalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information.\n  Access was denied to this resource.<br/><br/>\nInvalid or non-existent authentication information. See https://pypi.org/help/#invalid-auth for more information.\n\n\n \n'

Lösung

Melde dich bei PyPI mit poetry an (die Fehlermeldung fordert dich auf, dich erneut anzumelden, selbst wenn du bereits angemeldet bist). Du benötigst den PyPI-API-Token dafür, nicht dein PyPI-Passwort. Wenn du keinen Token hast, erstelle einen auf PyPI.

poetry_config_token.sh
poetry config pypi-token.pypi pypi-.....

Versuche dann erneut zu veröffentlichen:

poetry_publish_build.sh
poetry publish --build

Check out similar posts by category: Python