{"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,"search_vec":"'1.4.2':10 '2026':15 '25':14 'author':21 'build':1,6,23 'correct':4 'current':8 'frontend':7,26 'maintain':16 'march':13 'packag':20,24 'pypa':22 'python':5,19,25 'releas':11 'simpl':3 'version':9","created_at":"2026-03-28T11:14:21.447801+00:00","updated_at":"2026-04-16T01:05:39.686416+00:00","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,"quickstart_score":0,"quickstart_tag":"stale","pypi_latest":"1.5.0","cli_name":"build","cli_version":"sh: 1: build: not found","type":"library","homepage":"https://build.pypa.io","github":"https://github.com/pypa/build","docs":null,"changelog":"https://build.pypa.io/en/stable/changelog.html","pypi":"https://pypi.org/project/build/","npm":null,"openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":"passing","verified_at":"2026-06-28","last_verified":"2026-06-28","next_check":"2026-07-28","install_tag":"verified"}}