This post tells you how to upload your package to PyPI by an API token.
Skip this step if you’ve already got an account.
You can go to PyPI website to register an account.
Skip this step if you’ve already got a token for your device and your project.
Please sign in PyPI website and click your name then click
Add API token in the
API tokens section, set the token name and scope, and click
Please copy the token immediately since the API token will only be displayed once. If you forget to do that, revoke and create a new one.
If you don’t have a
.pypirc file in your project directory, please create it.
Then write the following content into the
username is always
password is your API token which has been created in the previous step.
Skip this step if you’ve already installed it in your Python environment.
pip install --upgrade twine
Run the following script to ensure your package files are valid.
twine check dist/*
Run the following script to upload your packages to PyPI.
twine upload dist/*
You should not be prompted for a username or password, since those are configure in your