question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

TestPyPI: "ERROR: No matching distribution found for setuptools" for PEP517-style packaging (with pyproject.toml)

See original GitHub issue

I would like to forward this report of a problem related to the TestPyPI infrastructure: pypa/pip#9242

PEP517-style package installation via the TestPyPI infrastructure fails because (the wording might be wrong) TestPyPI does not serve setuptools that is required to build the package under isolation.

TestPyPI is advertised by popular tutorials used by packaging newbs. So I guess it’d be good if this is fixed or at least the beginners get some guidance on this issue.

Note that the same package installed through the real PyPI does not show this problem.

@uranusjr suggested a workaround:

If you need to test the installation right now, the easiest fix available without involving others would be to serve your own setuptools copy instead. Something like

pip wheel setuptools wheel -w ./wheels
pip install --find-links ./wheels --index-url https://test.pypi.org/simple ...

Issue Analytics

  • State:open
  • Created 3 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

3reactions
uranusjrcommented, Jan 18, 2021

--extra-index-url is deterministic. The issue is it’s not what people think it is 🙂

It is viable to use --extra-index-url for this, but not pointing it to pypi.org.

1reaction
uranusjrcommented, Jan 18, 2021

It is not a good idea to use --extra-index-url=https://pypi.org/simple here because the search results of --index-url and --extra-index-url are merged, not first-found-first-win. So if pypi.org has a package 2.1 while test.pypi.org has only package 2.0, package 2.1 from PyPI will be chosen over package 2.0 on TestPyPI. This is usually not the behaviour you’re looking for when using TestPyPI.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Developing under PEP 517 with TestPyPI causes problems
... 517-style package via TestPyPI fails with an error stating that “setuptools” is not available: ERROR: No matching distribution found for ...
Read more >
How to fix "No matching distribution found for {package name ...
I have not use test.pypi.org, but it looks when you install a package from there it only looks for dependencies on test.pypi.org, ...
Read more >
A Practical Guide to Setuptools and Pyproject.toml
An example driven guide to setting up and building a python package using Setuptools together with pyproject.toml.
Read more >
How to Package Python dependencies with PIP setuptools
Simply put, setup.py is a build script template distributed with Python's setuptools package. Setuptools is the Python Packaging Authority (PyPA) ...
Read more >
Publishing your Python packages on TestPyPi before ...
If you're just creating a package for learning purposes, there's no need (IMO) to pollute the official PyPi index with it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found