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 hatchNo compatibility data collected yet for this library.
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.
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`).
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`).
Refer to the Hatch v1.16.0 release notes and documentation for updated environment plugin API. All environments can now be used for building.
Upgrade Hatch to v1.16.5 or newer to ensure compatibility with `virtualenv`.
Upgrade Hatch to v1.16.3 or newer to resolve issues with dependency recognition and environment creation stability.
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.
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"]`.
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.
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.