[초보자 팁] PyPI twine upload 중 403이 뜰 때 대처법
원문은 Shawn Wang님이 에 게재했습니다. 이 블로그 구독하기
PyPI 패키징 생태계에 아직 익숙하지 않아서 최근 파이썬 패키지를 푸시하다가 문제가 생겼다:
$ python3 -m twine upload --repository testpypi dist/*
Uploading distributions to https://test.pypi.org/legacy/
Enter your username: swyx
Enter your password:
Uploading smol_dev-0.1-py3-none-any.whl
100% ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.4/7.4 kB • 00:00 • ?
WARNING Error during upload. Retry with the --verbose option for more details.
ERROR HTTPError: 403 Forbidden from https://test.pypi.org/legacy/
Invalid or non-existent authentication information. See https://test.pypi.org/help/#invalid-auth for more information.이 문제 때문에 몇 시간이나 발이 묶여 있었다. 똑똑한 친구가 hatch를 쓰고 __token__과 API 토큰 인증 방식을 써보라고 했지만 그것도 통하지 않았다. 결국 원인은 내가 기본 파이썬 튜토리얼 설명을 대충 훑어보다가 test.pypi.org가 pypi.org와는 다른 패키지 사이트라는 걸 깨닫지 못한 것이었다. 그래서 그냥 해당 부분을 빼면 된다:
$ python3 -m twine upload dist/*그리고 패키지 이름에 하이픈을 쓰지 않도록 주의해야 한다
- report-env
+ report_env내 기본 템플릿 저장소는 https://github.com/swyxio/report-env에서 볼 수 있다
글을 무작위로 읽기
댓글
로그인하고 댓글 남기기