Skip to content Skip to sidebar Skip to footer

Can't Upload Package To Pypi

I've been trying to upload a package to PyPi. I receive this error every time. Upload failed (403): Invalid or non-existent authentication information. error: Upload failed (403):

Solution 1:

python setup.py register and python setup.py upload are deprecated. Do not use them.

Follow the instructions in the Python Packaging Guide:

  1. Create an account on PyPI if you haven't yet.
  2. Create the source distribution and wheels for your package: python setup.py sdist bdist_wheel
  3. Install twine (or make sure you have version 2.0 or newer): pip install twine
  4. Check your distribution files for errors: twine check dist/*
  5. (Optional) Upload to the PyPI test server first (note: separate user registration required): twine upload --repository-url https://test.pypi.org/legacy/ dist/*
  6. Upload to PyPI: twine upload dist/*

Solution 2:

Maybe double check that the .pypirc files is actually in the same directory as setup.py, since in your question you have called it '~/.pypirc'. The '~/' indicates that the file is in your home directory, which I assume is not where you want it to be.

Post a Comment for "Can't Upload Package To Pypi"