Registry / devops / hatch
library1.16.5pypypiunverified

Hatch is a modern, extensible Python project manager that centralizes environment management, packaging with Hatchling, versioning, and publishing behind a single command-line interface. It is known for its ability to seamlessly manage multiple environments, handle dependencies, and dynamically download required Python distributions. Currently at version 1.16.5, Hatch maintains an active development and release cadence.

pip install hatch
INSTALL
IMPORT
SIG · HATCH
H
hatch
devopspythonv1.16.5
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Hatch is primarily a CLI tool. This quickstart demonstrates creating a new project and running a simple command within its managed environment. The `hatch new` command scaffolds a new project with a `pyproject.toml` file, and `hatch run` executes commands within the project's isolated environment.

# Create a new Python project hatch new "My Awesome Project" # Navigate into the project directory cd "my-awesome-project" # Run a script (e.g., 'python -m my_awesome_project') # This assumes a default `run` script is defined in pyproject.toml hatch run python -c "print('Hello from Hatch!')" # Or enter a shell environment # hatch shell
hatch --version
Debug
Known issues
breakingHatch v1.16.0 dropped official support for Python 3.9. Projects requiring Python 3.9 or older must use an earlier version of Hatch.
fix
Upgrade your project's Python version to 3.10 or newer, or pin Hatch to a version <1.16.0 (e.g., `hatch<1.16.0`).
affects: >=1.16.0
breakingHatch v1.15.0 dropped official support for Python 3.8. Projects requiring Python 3.8 or older must use an earlier version of Hatch.
fix
Upgrade your project's Python version to 3.9 or newer, or pin Hatch to a version <1.15.0 (e.g., `hatch<1.15.0`).
affects: >=1.15.0
breakingIn Hatch v1.16.0, several environment type plugin methods were removed (`build_environment`, `build_environment_exists`, `run_builder`, `construct_build_command`). Custom environment plugins might need updates.
fix
Refer to the Hatch v1.16.0 release notes and documentation for updated environment plugin API. All environments can now be used for building.
affects: >=1.16.0
gotchaHatch v1.16.5 fixed a breaking change in `virtualenv` by explicitly supporting only the latest version and adding `python-discovery` as a dependency. Older Hatch versions might encounter issues with newer `virtualenv`.
fix
Upgrade Hatch to v1.16.5 or newer to ensure compatibility with `virtualenv`.
affects: <1.16.5
gotchaPrior to v1.16.3, there were known issues with self-referential dependencies not being recognized and incomplete environments being created when exceptions occurred during environment setup.
fix
Upgrade Hatch to v1.16.3 or newer to resolve issues with dependency recognition and environment creation stability.
affects: <1.16.3
Errors
Common errors & fixes
hatch: command not found
The 'hatch' executable is not located in your system's PATH environment variable, or Hatch was not installed correctly.
fix
Ensure Hatch is installed globally using `pipx install hatch` (recommended) or one of the official standalone installers for your operating system. After installation, restart your terminal to refresh the PATH.
ModuleNotFoundError: No module named 'your_package_name'
When using a `src` directory layout, the Python interpreter within the Hatch environment may not correctly locate your project's main package, often due to missing or incorrect `packages` configuration in `pyproject.toml`.
fix
Ensure your `pyproject.toml` correctly specifies the package location. If using a `src` layout, add or verify the `packages` entry under `[tool.hatch.build.targets.wheel]` (or other relevant build target) to point to your source directory, e.g., `packages = ["src/your_package_name"]`.
error: subprocess-exited-with-error × Preparing editable metadata (pyproject.toml) did not run successfully.
A subprocess involved in building editable metadata or installing build dependencies failed. This can be due to file locking by an IDE, missing build hook dependencies, or environmental issues, particularly on Windows.
fix
Try closing any IDEs (like VS Code) that might be locking project files. Ensure all necessary build hook dependencies are declared in `build-system.requires` or within the specific hook's configuration in `pyproject.toml`. If the issue persists, try deleting the `.hatch` directory (usually in your user's local application data) to force a clean environment recreation.
Hatch didn't provide any environment to select.
This error occurs in PyCharm when its Hatch plugin or specific Hatch environment plugins interfere with PyCharm's ability to discover and list available Hatch environments.
fix
As a workaround, you can try disabling certain Hatch environment plugins (e.g., `hatch-pip-compile`) by commenting them out in your `pyproject.toml` (e.g., `#[tool.hatch.envs.default.plugins.pip-compile]`), then prune and recreate the environment using `hatch env prune` and `hatch env create`. Additionally, ensure both PyCharm and its Hatch plugin are updated to their latest versions.
Upgrade
Version history
1.16.5latest on PyPI · released Feb 27, 2026
Audit
Dependencies
hatchlingrequiredHatch's standardized build backend.
python-discoveryrequiredAdded in v1.16.5 to handle breaking changes in `virtualenv`.
clickrequiredCLI toolkit dependency.
richrequiredUsed for rich terminal output.
Agent activity
9 hits · last 30 days
node
8
Resources
hatch — pip install hatch · libregistry