A simple, correct Python build frontend. Current version: 1.4.2. Released on March 25, 2026. Maintained by the Python Packaging Authority (PyPa).
pip install buildVerified import paths — ran on the pinned version, not inferred.
Builds the package in the current directory, generating a source distribution and wheel in the 'dist/' directory.
Update your build dependencies to include 'pyproject_hooks' and adjust your build backend to 'flit'.
Upgrade your Python environment to version 3.7 or later.
Replace `build.build()` with a call to `build.ProjectBuilder().build()`. For example, `from build import ProjectBuilder; ProjectBuilder().build('./', 'dist/')`.Replace `build.build()` with `build.ProjectBuilder().build()` in your script.
You need to install the 'build' package using pip: `pip install build`
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.
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`.
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.