twine: 403 Client Error: Invalid or non-existent authentication information.
Your Environment
-
Your operating system: Ubuntu 18.10
-
Version of python you are running:
Python 2.7.15+
- How did you install twine? Did you use your operating system’s package manager or pip or something else?
I followed instructions at https://pypi.org/project/twine/
pip install twine
Then when I tried to run it, I was instructed to run:
sudo apt install twine
- Version of twine you have installed (include complete output of):
twine version 1.11.0 (pkginfo: 1.4.2, requests: 2.18.4, setuptools: 40.2.0,
requests-toolbelt: 0.8.0, tqdm: 4.23.4)
- Which package repository are you targeting?
I don’t know what this means.
$ cat darip.egg-info/PKG-INFO
Metadata-Version: 1.0
Name: darip
Version: 1.0.0
Summary: Bulk downloads images from Deviant Art
Home-page: https://github.com/kstenerud/darip/
Author: Karl Stenerud
Author-email: kstenerud@gmail.com
License: UNKNOWN
Description: UNKNOWN
Platform: UNKNOWN
$ cat ~/.pypirc
cat: /home/karl/.pypirc: No such file or directory
The Issue
I get an HTTP error following the instructions at https://pypi.org/project/twine/
Steps to Reproduce
If the issue is predictable and consistently reproducible, please list the steps here.
$ twine upload --repository-url https://test.pypi.org/legacy/ dist/*
Uploading distributions to https://test.pypi.org/legacy/
Enter your username: kstenerud
Enter your password:
Uploading darip-1.0.0-py2-none-any.whl
100%|██████████████████████████████████████████████████████████████████████████████████████████████████| 8.02k/8.02k [00:00<00:00, 9.58kB/s]
HTTPError: 403 Client Error: Invalid or non-existent authentication information. for url: https://test.pypi.org/legacy/
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (5 by maintainers)
Instead of twine upload --repository-url https://test.pypi.org/legacy/ dist/*
write twine upload --repository-url https://upload.pypi.org/legacy/ dist/*
I was also having same problem but by typing commands this way, my problem got solved.
@Foxgeek36 and @Kamleshgupta1:
The correct solution when
--repository-url https://test.pypi.org/legacy/
fails due toInvalid or non-existent authentication information
is to create an account on https://test.pypi.org/, which is “a separate instance of the Python Package Index that allows you to try distribution tools and processes without affecting the real index.”Using
--repository-url https://upload.pypi.org/legacy/
will upload your package to https://pypi.org/, which publishes it “for real”.the perfect solution
hi, when we enter the password, the password is definitely not wrong and I think it’s a bug. so I try to use
it really works for me.
thanks:)
-u
for the username and-p
for the password directly without using the fields provided by the console (default). I try to run this in the command:twine upload -u YOUR-USERNAME -p YOUR-PASSWORD - repository-url https://test.pypi.org/legacy/ dist / *
https://test.pypi.org/user/kstenerud/ does not exist. You have to create your login there first.
The error message could be improved by PyPI but is not in the domain of Twine in my opinion.
C:\python with ai\pykh>twine upload -u salah100 -p khizerkamranpp - repository-url https://test.pypi.org/legacy/ dist / * InvalidDistribution: Cannot find file (or expand pattern): ‘-’
Having verified accounts in PyPI and TestPyPI, contents for
~/.pypi
:After building the package, publishing for TestPyPI:
Publishing for PyPI:
Thanks @vsay01 and @adamcanray this worked!
twine upload -u 'USERNAME' -p 'PASSWORD' --repository-url https://upload.pypi.org/legacy/ dist/*
Here are my other config options
.pypirc
.localrc