Need Packaging support

I am creating PYPI package for the first time and I am unable to upload it to PYPI.Can someone help me with this?


How can I solve this issue?

Did you read the information provided at the link shown in the error message? Did you follow the hints at this link?

3 Likes

Yes.Thats how I landed here.What ever I paste the token is always hidden?How will I know the token is pasted or not?

You sure you use the credentials for the TEST instance of PyPI? The main PyPI and the test instance do not use the same credentials. You need to create separate accounts.

Oh.I thought it’s optional.I will create and try.

What is the difference between https://test.pypi.org and https://pypi.org?

Thank you for helping. I was trying this for long time and I finally succeed in creating my first package.

1 Like

https://test.pypi.org/ is for you to test your package before releasing it for real on https://pypi.org/.

Typically you would create your sdist and your wheel(s), upload them to test PyPI. Then maybe check if the description renders correctly on the test PyPI website, if all the metadata values are rendered correctly. Then maybe you would try to install your package from test PyPI, in order to check if all the necessary files are in the sdist and wheel(s). And check a bunch of other things as well. Once you are happy with all these checks, you would upload to the real PyPI server.

As far as I recall, the test PyPI server is different in that there is no guarantee that distribution packages (sdists and wheels) are kept forever. There is much less scrutiny (if any at all) in terms of typosquatting, safety checks and so on.

An important recommendation when downloading (and installing) from the test PyPI server is to only download what you uploaded yourself and nothing else. So typically you would run something like the following, the important bits being the usage of the --no-deps flag, making sure to use the correct distribution package name (here my-new-library) and the correct version string (here 1.2.3):

python -m pip install --index-url https://test.pypi.org/simple/ --no-deps 'my-new-library==1.2.3'
2 Likes

How to release it on https://pypi.org/ from Https://test.pypi.org/?

There is no path to move distribution packages (sdists and wheels) from https://test.pypi.org/ to https://pypi.org/. You have to repeat the upload process on the main PyPI server, using the same distribution packages that you uploaded on the test server. And you should indeed try to upload the exact same distributions packages, you should avoid to rebuild them (otherwise you would publish something that you have not checked on the test server).