Maaz Zindani

Loading the index…

↑↓ move↵ openesc close4791 pages
Node.js, PHP and APIs

setuptools warns that its own installer for setup_requires is deprecated

Your error

_DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.3 more lines it can show

Fix it fast

Most common cause, 1 of 2

setup_requires is declared and setup.py is run directly as a script

Copy every setup_requires entry into requires under [build-system] in pyproject.toml, delete the keyword from setup() (and any setup_requires line in setup.cfg, which setuptools also honours), and let a frontend run the build. python -m build replaces sdist and bdist_wheel, pip install . replaces install, and pip install --editable . replaces develop.

Fix
# pyproject.toml (setup.py no longer passes setup_requires)
[build-system]
requires = ["setuptools>=77.0.3", "cython"]
build-backend = "setuptools.build_meta"
Did this fix it?
Full steps for this cause: check, fix, verify

Short answer

setuptools prints setuptools.installer and fetch_build_eggs are deprecated when setup.py lists setup_requires and runs outside a PEP 517 frontend: python setup.py <command>, or pip older than 25.3. Move those packages into [build-system] requires in pyproject.toml, remove setup_requires, and build with pip or python -m build. Seen with setuptools 59.1 through 84.

  • Applies to setuptools 84.2, pip 26.3, build 1.6, Python 3.10 and later
  • Updated
  • By Maaz Zindani, Senior Software Engineer

Which cause do you have?

Find the setup_requires entries, see whether the project has a pyproject.toml, and note which pip builds it. A command that starts with python setup.py points to cause 1; a pip release older than 25.3 on a project without pyproject.toml points to cause 2.

Run this first
grep -n "setup_requires" setup.py setup.cfg 2>/dev/null
ls pyproject.toml
python -m pip --version

Then find the line you see in this list and open its fix:

  1. 1setup_requires is declared and setup.py is run directly as a scriptThe message follows a command such as python setup.py sdist, bdist_wheel, develop or build_ext, and the quoted source line is dist.fetch_build_eggs(dist.setup_requires)
  2. 2An old pip falls back to running setup.py for a project with no pyproject.tomlThe warning appears inside pip install output, pip --version reports 25.2 or older, and the project has no pyproject.toml

What does the error look like?

  • _DeprecatedInstaller: setuptools.installer and fetch_build_eggs are deprecated.
  • Requirements should be satisfied by a PEP 517 installer.
  • If you are using pip, you can try `pip install --use-pep517`.
  • dist.fetch_build_eggs(dist.setup_requires)

Cause 1 of 2

setup_requires is declared and setup.py is run directly as a script

You seeThe message follows a command such as python setup.py sdist, bdist_wheel, develop or build_ext, and the quoted source line is dist.fetch_build_eggs(dist.setup_requires)

Check

The fetch_build_eggs deprecation fires when setup() runs as a plain script with packages to fetch for setup_requires. Under a PEP 517 build, setuptools switches that install step off and reports the list to the frontend instead, so only direct runs reach the deprecated installer. setuptools has also deprecated python setup.py <command> itself.

Check
python setup.py --version 2>&1 | grep -c fetch_build_eggs

Fix

Copy every setup_requires entry into requires under [build-system] in pyproject.toml, delete the keyword from setup() (and any setup_requires line in setup.cfg, which setuptools also honours), and let a frontend run the build. python -m build replaces sdist and bdist_wheel, pip install . replaces install, and pip install --editable . replaces develop.

Fix
# pyproject.toml (setup.py no longer passes setup_requires)
[build-system]
requires = ["setuptools>=77.0.3", "cython"]
build-backend = "setuptools.build_meta"

Verify

The build produces the sdist and wheel, and grep counts zero fetch_build_eggs lines.

Verify
python -m pip install build
python -m build 2>&1 | grep -c fetch_build_eggs

Confirmed by setuptools.pypa.io

Did this fix it?

Cause 2 of 2

An old pip falls back to running setup.py for a project with no pyproject.toml

You seeThe warning appears inside pip install output, pip --version reports 25.2 or older, and the project has no pyproject.toml

Check

Before 25.3, pip could still call setup.py bdist_wheel or setup.py develop itself, which takes the deprecated setup_requires route. pip 25.3 removed both mechanisms and made PEP 517 builds permanent; that change is also why the --use-pep517 hint inside the message no longer alters anything.

Check
python -m pip --version

Fix

Upgrade pip in whatever environment runs the build (local venv, CI image, Dockerfile), and add a pyproject.toml with a [build-system] table so every frontend takes the standard path.

Fix
python -m pip install --upgrade "pip>=25.3"

Verify

A verbose install of the project shows the backend output with no fetch_build_eggs warning.

Verify
python -m pip install . -v 2>&1 | grep -c fetch_build_eggs

Confirmed by pip.pypa.io

Did this fix it?

How do I stop it coming back?

  • Put every package that setup.py imports at build time (Cython, numpy, setuptools-scm) in [build-system] requires and nowhere else.
  • Swap python setup.py calls in Makefiles, tox.ini and CI scripts for python -m build or pip install.
  • Start CI builds with python -m pip install --upgrade "pip>=25.3" so no image falls back to the legacy route.
  • Add a pre-commit or CI grep that fails when setup_requires reappears in setup.py or setup.cfg.

Sources

How was this page made?

I drafted this page with AI assistance from the official documents listed under Sources. Every cause above names the document that confirms it. I have not reproduced this fix on a machine of my own yet, so read it as documented guidance, not a test report. Found a mistake? Tell me.

Which stack is behind this page?

Projects of mine on the same stack: stegnor.com, Menulo, ShopGo.

Next step

Want this handled for good?

I look after servers, apps and releases end to end. Tell me what keeps breaking.