3

I am just trying to create a python package on testPyPI for some testing (using twine), following this official guide. I am using a token, which succeeded exactly one time (username __token__, password is the token itself). Then I made a change and wanted to repeat that process, it doesn't work anymore.

related post

This seems to be a common issue, however I couldn't fix it so far. I'm on Windows 10, this is what I tried...

  • different ways of pasting into the console and different consoles (so that's not the issue)
  • using a .pypirc file for authentication details
  • a new token
  • a new account
  • a new email
  • also directly inserting username and password into the twine command (which should be avoided, I guess)

And I'm running out of ideas. Any clue?

nutrx
  • 116
  • 4

1 Answers1

1

I was struggling with the same issue. The tutorial OP referred to is, in my opinion, not explicit enough, because there tend to be two ways, which can easily be mixed (as I was doing, however, I am a newbie following the tutorial for a reason ;) ).

Solution: Assuming a /home/.pypirc file is created you can either

  1. use credentials (i.e, use username and password for logging into the website):
[testpypi]
  username = <your username>
  password = <your password>
  1. or use the API token created on the website:
[testpypi]
  username = __token__
  password = pypi-<Rest of token>

Hope that helps others following the tutorial.

marcel h
  • 742
  • 1
  • 7
  • 20