Pypi Error Upload Failed 403 Invalid or Non Existent Authentication Information Windows
Publish your own wheels-PyPI package upload practice
Uploadfailed(403):Invalidornon-existentauthenticationdata
The reason for the mistake:, the python setup.py sdist upload
upload method is currently obsolete .
Solution: Use twine : twine upload dist/*
This article only discusses the steps related to uploading. For how to write one setup.py
, please refer to the official certificate:
- https://docs.python.org/ii/dis...
Precautions before uploading
- Assuming that your packet has been adult, and there must exist a setup.py in the root directory .
- It is best to have a README.rst to describe your wheels. Although this is non necessary, the certificate is like underwear, y'all better take it.
- If you need to package files outside the lawmaking binder, such as copyright information, etc., you likewise demand to write a MANIFEST.in .
Near setup.py
supplementary explanation
-
name
It must be unique. Numbers and letters are allowed. Information technology is recommended to use the underscore (-) instead of the underscore (_), because the pip installation just supports the underscore. For casepip install my-pkg
, please exist obedient in order not to trouble yourself. -
version
It is recommended to follow the semantic version number rule, which is simply similar this: 1.2.0 - The writer'south name and electronic mail address do non have to be the same as your PyPI business relationship.
Exam local packaging commands
If none of the above is a problem, executing the following command in the local directory should be able to successfully generate the *.tar.gz package file in the dist directory.
python setup.py sdist
Upload and publish the bundle file to PyPI
Create a PyPI business relationship
It's very unproblematic. Register straight through the official website https://pypi.python.org/pypi?... , just you need to verify the e-mail and confirm the activation.
Create user authentication file ~/.pypirc
Create a new blank file in your user directory and name it as .pypirc
follows:
[distutils] index-servers=pypi [pypi] repository = https://upload.pypi.org/legacy/ username = <username> password = <password>
The user name and password are those created in the previous pace, and enter them directly in manifestly text. If you lot think the plaintext password is non safe, you can exit information technology bare, and yous volition exist prompted to enter it manually during the upload procedure.
Annals your package
You lot need to register and verify your packet with PyPI before you can really upload it. There are several means to annals.
- The apply of commands is
python setup.py register
the simplest, but the official website is not recommended, considering the use of HTTP is not encrypted, you may be sniffed past attackers to your password. - Submit the form through the PyPI website to consummate the registration verification.
- The installation
pip install twine
sotwine annals dist/mypkg.whl
completes the registration through the control .
Upload and finish publishing
You can choose one of the following 2 means to publish your wheels.
- Use the command:, the
python setup.py sdist upload
same as above, uncomplicated just with potential rubber hazards, it has been eliminated at present . - Utilise twine :
twine upload dist/*
Manage your package
If your package has been uploaded successfully, and so when y'all log in to the PyPI website, you lot should be able to see the management entry in the navigation bar on the right.
After clicking the package name, you can manage your package. Of course, y'all tin can too delete the package from here.
Permit others use your bag
After the package is released, others simply need to use pip to install your package file. such equally:
pip install package-name
If you lot update the parcel, others can --update
update via parameters:
pip install package-name --update
Possible errors
Upload failed (403): Invalid or not-existent authentication data.
Wrong user authentication information, you need to create a user hallmark file ~/.pypirc
. See above.
Upload failed (403): You lot are not immune to edit 'xxx' packet information
Y'all need to register your bundle earlier you can start uploading, run the registration command: python setup.py annals
Server response (401): Incomplete registration; cheque your email
Your PyPI account has not completed the email verification, you demand to go to the registered email accost to find a verification email to consummate the verification and try the failed steps again.
Server response (400): Invalid classifier "Topic :: Software Development :: Utilities"
The classifier information in your setup.py file is wrong, please write the classifier co-ordinate to the right classification on the official website .
error: No dist file created in earlier command
You started the upload command before packaging. Information technology is recommended that the packaging and uploading operations be done together, such as:
python setup sdist upload
error: Upload failed (499): Customer Disconnected
This should be a network problem, try several times.
Upload failed (400): File already exists
The file already exists, and you should update the version number every fourth dimension.
Reference documents
- https://packaging.python.org/...
About the writer: Python engineering enthusiasts, currently engaged in examination development related work, please indicate the original source.Welcome to follow my weblog https://betacat.online , you can go to my official business relationship to be the oversupply.
Source: https://www.codetd.com/en/article/12946549
Posting Komentar untuk "Pypi Error Upload Failed 403 Invalid or Non Existent Authentication Information Windows"