Error: Upload Failed (403): Invalid or Non-existent Authentication Information.
Publish your own wheels-PyPI package upload do
Uploadfailed(403):Invalidornon-existentauthenticationdata
The reason for the fault:, the python setup.py sdist upload upload method is currently obsolete .
Solution: Use twine : twine upload dist/*
This article just discusses the steps related to uploading. For how to write one setup.py , delight refer to the official certificate:
- https://docs.python.org/2/dis...
Precautions before uploading
- Assuming that your package has been developed, and at that place must exist a setup.py in the root directory .
- It is best to take a README.rst to describe your wheels. Although this is not necessary, the document is similar underwear, you better take it.
- If y'all need to package files outside the code folder, such every bit copyright information, etc., y'all also need to write a MANIFEST.in .
About setup.py supplementary explanation
-
nameIt must be unique. Numbers and letters are allowed. It is recommended to utilize the underscore (-) instead of the underscore (_), because the pip installation only supports the underscore. For examplepip install my-pkg, please be obedient in order not to problem yourself. -
versionIt is recommended to follow the semantic version number dominion, which is simply similar this: 1.two.0 - The author'due south name and email accost do not have to be the same as your PyPI business relationship.
Test local packaging commands
If none of the above is a problem, executing the following control in the local directory should be able to successfully generate the *.tar.gz bundle file in the dist directory.
python setup.py sdist Upload and publish the parcel file to PyPI
Create a PyPI business relationship
It's very simple. Register directly through the official website https://pypi.python.org/pypi?... , only you need to verify the email and confirm the activation.
Create user hallmark 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 proper noun and password are those created in the previous step, and enter them directly in plain text. If you think the plaintext password is non prophylactic, you can leave it bare, and you volition be prompted to enter it manually during the upload process.
Register your packet
You need to register and verify your package with PyPI earlier you tin can actually upload it. There are several ways to register.
- The use of commands is
python setup.py registerthe simplest, but the official website is not recommended, considering the utilize of HTTP is not encrypted, y'all may exist sniffed past attackers to your password. - Submit the course through the PyPI website to complete the registration verification.
- The installation
pip install twineand thentwine annals dist/mypkg.whlcompletes the registration through the control .
Upload and finish publishing
Yous tin can choose ane of the following 2 ways to publish your wheels.
- Utilize the command:, the
python setup.py sdist uploadsame as above, simple but with potential safe hazards, it has been eliminated at present . - Utilise twine :
twine upload dist/*
Manage your packet
If your package has been uploaded successfully, then when yous log in to the PyPI website, yous should be able to meet the management entry in the navigation bar on the right.
Later clicking the package proper name, you can manage your packet. Of form, y'all tin can also delete the packet from here.
Let others apply your bag
Subsequently the package is released, others just need to utilize pip to install your package file. such as:
pip install package-name If y'all update the parcel, others can --update update via parameters:
pip install bundle-name --update Possible errors
Upload failed (403): Invalid or not-real authentication information.
Incorrect user authentication data, you demand to create a user hallmark file ~/.pypirc . See above.
Upload failed (403): Y'all are not allowed to edit 'xxx' parcel data
You lot need to register your package before you lot tin can starting time uploading, run the registration command: python setup.py register
Server response (401): Incomplete registration; check your email
Your PyPI account has not completed the electronic mail verification, you demand to go to the registered email accost to find a verification email to complete the verification and try the failed steps again.
Server response (400): Invalid classifier "Topic :: Software Development :: Utilities"
The classifier data in your setup.py file is wrong, please write the classifier co-ordinate to the correct classification on the official website .
error: No dist file created in before command
You started the upload control earlier packaging. Information technology is recommended that the packaging and uploading operations exist washed together, such every bit:
python setup sdist upload fault: Upload failed (499): Client Disconnected
This should be a network trouble, endeavour several times.
Upload failed (400): File already exists
The file already exists, and yous should update the version number every time.
Reference documents
- https://packaging.python.org/...
About the author: Python engineering science enthusiasts, currently engaged in test development related work, delight signal the original source.Welcome to follow my weblog https://betacat.online , you tin can go to my official account to be the oversupply.
Source: https://www.codetd.com/en/article/12946549
0 Response to "Error: Upload Failed (403): Invalid or Non-existent Authentication Information."
Post a Comment