Summary
Running uv build with a custom [build-system].backend-path in pyproject.toml results in a ModuleNotFoundError. It appears that in one step of the isolated build, the referenced directory is not copied to the temporary build directory
Running uv pip install . runs without problems though.
[build-system]
requires = [
# ...
]
build-backend = "my_backend:builder"
backend-path = ["backend_dir"]
PoC
A minimal poc is available at https://github.com/markuspi/uv_backend_path_poc
-
Checkout PoC and cd into repo root
-
Run uv build --no-cache --verbose
-
Observe error:
full_error.txt
Traceback (most recent call last):
File "<string>", line 8, in <module>
from my_backend import builder as backend
ModuleNotFoundError: No module named 'my_backend'
× Failed to build `D:\dev\repos\poc_backend_path`
├─▶ The build backend returned an error
╰─▶ Call to `my_backend:builder.build_wheel` failed (exit code: 1)
hint: This error likely indicates that `poc-backend-path@0.1.0` depends on `my_backend`, but doesn't declare it as a build dependency. If `poc-backend-path` is a first-party package, consider adding `my_backend` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under:
[tool.uv.extra-build-dependencies]
poc-backend-path = ["my_backend"]
or `uv pip install my_backend` into the environment and re-run with `--no-build-isolation`.
-
Running uv pip install works without problem
uv venv venv2
uv pip install --no-cache -p venv2 .
Platform
Windows 11 x86_64
Version
uv 0.11.19 (7b2cff1 2026-06-03 x86_64-pc-windows-msvc)
Python version
No response
Summary
Running
uv buildwith a custom[build-system].backend-pathinpyproject.tomlresults in aModuleNotFoundError. It appears that in one step of the isolated build, the referenced directory is not copied to the temporary build directoryRunning
uv pip install .runs without problems though.PoC
A minimal poc is available at https://github.com/markuspi/uv_backend_path_poc
Checkout PoC and
cdinto repo rootRun
uv build --no-cache --verboseObserve error:
full_error.txt
Traceback (most recent call last): File "<string>", line 8, in <module> from my_backend import builder as backend ModuleNotFoundError: No module named 'my_backend' × Failed to build `D:\dev\repos\poc_backend_path` ├─▶ The build backend returned an error ╰─▶ Call to `my_backend:builder.build_wheel` failed (exit code: 1) hint: This error likely indicates that `poc-backend-path@0.1.0` depends on `my_backend`, but doesn't declare it as a build dependency. If `poc-backend-path` is a first-party package, consider adding `my_backend` to its `build-system.requires`. Otherwise, either add it to your `pyproject.toml` under: [tool.uv.extra-build-dependencies] poc-backend-path = ["my_backend"] or `uv pip install my_backend` into the environment and re-run with `--no-build-isolation`.Running
uv pip installworks without problemPlatform
Windows 11 x86_64
Version
uv 0.11.19 (7b2cff1 2026-06-03 x86_64-pc-windows-msvc)
Python version
No response