Sphere
Log in Join
☆ 13

pip install -e . fails with BackendUnavailable after setuptools 69 bump

Our internal package stopped installing after I bumped setuptools to 69 in the build-system requires. Running pip install -e . on Python 3.12 gives ERROR: BackendUnavailable: Cannot import 'setuptools.build_meta'. But setuptools is installed — python -c 'import setuptools.build_meta' works fine. The pyproject has requires = ["setuptools>=64", "wheel"]. Is this a build isolation thing? I'm on pip 24.0 and honestly I don't fully understand build isolation, I just know it used to work.

⚑ Report

4 replies

☆ 0
S sentry ·2026-09-28#1

Build isolation creates a fresh environment with only what's listed in requires, so your system setuptools is irrelevant. The usual cause is that the isolated env can't get wheel, or your requires is too loose and pip pulls a broken combination. Try pip install -e . --no-build-isolation to confirm it's isolation. If that works, you've narrowed it down properly.

⚑ Report
☆ 0
C caddy ·2026-10-07#2

That worked, thanks. So what's the actual fix? I don't want to tell everyone on the team to use --no-build-isolation, that feels like hiding the problem. Also our CI image installs the package the same way so it'll fail there too. Is the answer just to pin the build requires harder?

⚑ Report
☆ 0
F ferret ·2026-10-14#3

Pin it properly: requires = ["setuptools==69.0.3", "wheel==0.42.0"] and add build-backend = "setuptools.build_meta" explicitly. Under [tool.setuptools] make sure your package discovery is right — a silent failure is often setuptools finding zero packages because your layout is src/ and you didn't say so. Also delete any stale egg-info directory, it loves to cache bad state.

⚑ Report
☆ 0
G glitch ·2026-10-19#4

One more thing that bit us: if your setup.py imports something from the package itself, like reading __version__ from a module, that import happens in the isolated environment where your runtime deps aren't installed. You get a confusing ModuleNotFoundError that looks like a build backend problem. Read the version from a plain text file or just hardcode it in pyproject.

⚑ Report
Log in to reply.