{"id":385,"library":"build","title":"build","description":"A simple, correct Python build frontend. Current version: 1.4.2. Released on March 25, 2026. Maintained by the Python Packaging Authority (PyPa).","status":"active","version":"1.4.2","language":"python","source_language":"en","source_url":"https://github.com/pypa/build","tags":["build","packaging","python","frontend"],"install":[{"cmd":"pip install build","lang":"bash","label":"Install build"}],"dependencies":[{"reason":"Replaces the 'pep517' dependency; 'pep517' has been renamed to 'pyproject_hooks' in build 0.10.0. ([build.pypa.io](https://build.pypa.io/en/latest/changelog.html?utm_source=openai))","package":"pyproject_hooks","optional":false}],"imports":[{"note":"Ensure 'build' is installed in your environment before importing.","symbol":"build","correct":"import build"}],"quickstart":{"code":"import build\n\n# Build the package in the current directory\nbuild.build()  # This will build the package in an isolated environment, generating a source distribution and wheel in the 'dist/' directory.","lang":"python","description":"Builds the package in the current directory, generating a source distribution and wheel in the 'dist/' directory."},"warnings":[{"fix":"Update your build dependencies to include 'pyproject_hooks' and adjust your build backend to 'flit'.","message":"In build 0.10.0, the 'pep517' dependency was replaced with 'pyproject_hooks', and the build backend was changed from 'setuptools' to 'flit'.","severity":"breaking","affected_versions":"0.10.0"},{"fix":"Upgrade your Python environment to version 3.7 or later.","message":"Support for Python 3.6 was dropped in build 0.10.0.","severity":"breaking","affected_versions":"0.10.0"},{"fix":"Replace `build.build()` with a call to `build.ProjectBuilder().build()`. For example, `from build import ProjectBuilder; ProjectBuilder().build('./', 'dist/')`.","message":"The function `build.build()` does not exist in the `python-build` package's public API. The primary programmatic interface for building packages is `build.ProjectBuilder().build()`.","severity":"breaking","affected_versions":"0.10.0"},{"fix":"Replace `build.build()` with `build.ProjectBuilder().build()` in your script.","message":"The top-level `build` function in the `build` module was removed. Use `build.ProjectBuilder().build()` instead.","severity":"breaking","affected_versions":"0.10.0"}],"env_vars":null,"last_verified":"2026-05-12T13:27:12.576Z","next_check":"2026-06-26T00:00:00.000Z","problems":[{"fix":"You need to install the 'build' package using pip: `pip install build`","cause":"This error occurs when the 'build' package itself has not been installed in your Python environment, and you try to run it using `python -m build` or import it directly.","error":"ModuleNotFoundError: No module named 'build'"},{"fix":"Ensure you have the latest version of the 'build' package by running `pip install --upgrade build`. If the problem persists, check your `PYTHONPATH` environment variable for conflicting entries or rename any local directories named 'build' that might be interfering.","cause":"This error typically arises when there's an older or conflicting version of the 'build' package installed, or if a local directory named 'build' shadows the actual package, preventing the `__main__` module from being found during execution via `python -m build`.","error":"No module named build.__main__; 'build' is a package and cannot be directly executed"},{"fix":"Identify the specific package 'X' causing the issue and consult its documentation for build prerequisites. Common fixes include installing development headers (e.g., `sudo apt-get install python3-dev` on Debian/Ubuntu, `sudo dnf install python3-devel` on Red Hat/Fedora, or Xcode command-line tools on macOS) and ensuring that all build-time Python dependencies are correctly listed in the `pyproject.toml`'s `[build-system] requires` section. You might also try updating pip and setuptools: `pip install --upgrade pip setuptools`.","cause":"This is a generic error indicating that the 'build' frontend (or pip which uses it) failed to compile a wheel for a specific package (represented by 'X'), usually due to missing system-level dependencies (like compilers or development headers) or build-time Python dependencies not being correctly specified or installed in the isolated build environment.","error":"ERROR: Could not build wheels for X, which is required to install pyproject.toml-based projects"},{"fix":"Carefully review your `pyproject.toml` file for any typos, incorrect syntax, or adherence to deprecated metadata formats (e.g., for the `license` field). Refer to the official Python Packaging User Guide for the correct `pyproject.toml` specification. Tools like `toml-cli` can help validate the TOML syntax.","cause":"The `pyproject.toml` file, which specifies build system requirements and project metadata, contains a syntax error or uses a deprecated format that the `build` tool or its backend cannot parse.","error":"Invalid pyproject.toml file"}],"ecosystem":"pypi","meta_description":null,"install_score":100,"install_tag":"verified","quickstart_score":0,"quickstart_tag":"stale","pypi_latest":null,"install_checks":{"last_tested":"2026-05-12","tag":"verified","tag_description":"installs cleanly on critical runtimes, fast import, recently tested","results":[{"runtime":"python:3.10-alpine","python_version":"3.10","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":3.6,"disk_size":"18.8M"},{"runtime":"python:3.10-slim","python_version":"3.10","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.07,"mem_mb":3.6,"disk_size":"19M"},{"runtime":"python:3.11-alpine","python_version":"3.11","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.2,"mem_mb":5.7,"disk_size":"20.6M"},{"runtime":"python:3.11-slim","python_version":"3.11","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.21,"mem_mb":5.7,"disk_size":"21M"},{"runtime":"python:3.12-alpine","python_version":"3.12","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.17,"mem_mb":4.7,"disk_size":"12.5M"},{"runtime":"python:3.12-slim","python_version":"3.12","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.17,"mem_mb":4.7,"disk_size":"13M"},{"runtime":"python:3.13-alpine","python_version":"3.13","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.16,"mem_mb":4.9,"disk_size":"12.1M"},{"runtime":"python:3.13-slim","python_version":"3.13","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.15,"mem_mb":4.9,"disk_size":"13M"},{"runtime":"python:3.9-alpine","python_version":"3.9","os_libc":"alpine (musl)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.1,"mem_mb":3.5,"disk_size":"18.6M"},{"runtime":"python:3.9-slim","python_version":"3.9","os_libc":"slim (glibc)","variant":"default","exit_code":0,"wheel_type":null,"failure_reason":null,"install_time_s":null,"import_time_s":0.09,"mem_mb":3.5,"disk_size":"19M"}]},"quickstart_checks":{"last_tested":"2026-04-23","tag":"stale","tag_description":"widespread failures or data too old to trust","results":[{"runtime":"python:3.10-alpine","exit_code":1},{"runtime":"python:3.10-slim","exit_code":1},{"runtime":"python:3.11-alpine","exit_code":1},{"runtime":"python:3.11-slim","exit_code":1},{"runtime":"python:3.12-alpine","exit_code":1},{"runtime":"python:3.12-slim","exit_code":1},{"runtime":"python:3.13-alpine","exit_code":1},{"runtime":"python:3.13-slim","exit_code":1},{"runtime":"python:3.9-alpine","exit_code":1},{"runtime":"python:3.9-slim","exit_code":1}]}}