I am looking to deploy a Module to PyPI and this error is thrown in the console:
HTTPError: 403 Client Error: The credential associated with user 'aloisdg' isn't allowed to upload to project 'example-pkg-your-username'. See https://test.pypi.org/help/#project-name for more information. for url: https://test.pypi.org/legacy/
It is possible to reproduce the error by following step by step the tutorial in the official documentation: Packaging Python Projects.
My credential works fine when I try to connect to the PyPI website directly.
Why cant I upload my own package?
Go to your packages. Check the "remove" checkbox for the particular package. Click "Remove" button.
A . pypirc file allows you to define the configuration for package indexes (referred to here as “repositories”), so that you don't have to enter the URL, username, or password whenever you upload a package with twine or flit.
This error means that you can't upload this package because you, as a user, are not allowed to. Why? Because it is not your package. Someone already created a package with this name. Your package is seen as an update to this already existing package. You won't have this error if the original creator would include you as maintainer of this package.
How to fix this error? Replace example-pkg-your-username
with example-pkg-aloisdg
(or any name absent from PyPI).
This answer was inspired by issue #4607.
You missed this step in the tutorial:
Open
setup.py
and enter the following content. Update the package name to include your username (for example,example-pkg-theacodes
), this ensures that you have a unique package name and that your package doesn’t conflict with packages uploaded by other people following this tutorial.
Change the package name to be something unique and your upload will succeed.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With