9
votes

I'm trying to package a new project and upload it to the TestPyPI server. Because of the introduction of the new PyPI.org, virtually all the instructions I've found are out of date, and trying to upload to https://testpypi.python.org/pypi now returns 401 Gone.

The guide for migrating to the new PyPI.org says to use https://test.pypi.org/legacy as the repository for TestPyPI. However, when inserting this URL into my .pypirc file and trying to upload my package, I receive the following error:

python setup.py sdist upload -r testpypi
[...]
running upload
Submitting dist/<package_name> to https://test.pypi.org/legacy
Upload failed (404): Not Found
error: Upload failed (404): Not Found

Here are the contents of my ~/.pypirc file:

[distutils]
index-servers =
  pypi
  testpypi

[pypi]
repository: https://pypi.python.org/pypi
username: your_username
password: your_password

[testpypi]
repository: https://test.pypi.org/legacy
username: pbaranay
password: my_password
1

1 Answers

8
votes

The new URL for the Test PyPI repository is https://test.pypi.org/legacy/ -- note the trailing slash. The migration guide also says to use this URL (with the slash included).