Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why cant I upload my own package to PyPI when my credential are working?

Tags:

python

pypi

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?

like image 605
aloisdg Avatar asked Aug 12 '19 08:08

aloisdg


People also ask

Can a package be removed from PyPI?

Go to your packages. Check the "remove" checkbox for the particular package. Click "Remove" button.

What is Pypirc file?

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.


2 Answers

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.

like image 124
aloisdg Avatar answered Oct 12 '22 14:10

aloisdg


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.

like image 26
Dustin Ingram Avatar answered Oct 12 '22 12:10

Dustin Ingram