Skip to main content

Hatch plugin for conda environments

Project description


CI/CD CI - Test CD - Build
Package PyPI - Version PyPI - Python Version
Meta code style - black types - Mypy imports - isort License - MIT

This provides a plugin for Hatch that allows the use of conda environments.

This project is a copied and modified version of the hatch-containers plugin by Ofek Lev.

Table of Contents


pip install hatch-conda


The environment plugin name is conda.

  • pyproject.toml

    type = "conda"
  • hatch.toml

    type = "conda"


If the Python version is set to a multi-character integer like 310 then it will be interpreted as its <MAJOR>.<MINOR> form e.g. 3.10.

If not set, then the <MAJOR>.<MINOR> version of the first python found along your PATH will be used, defaulting to the Python executable Hatch is running on.


The command option specifies the command that will be used to setup the environment. The possible options are conda, mamba and micromamba.


command = "conda"


Indicates if the conda-forge index should be used.


conda-forge = true

Environment file

By default packages will be installed using pip. However, to install packages using conda, conda-forge, or any other channel, you can specify a conda environment file:

environment-file = "environment.yml"

When using an environment file, the channel and python version specified in the environment file will be used. After installing the environment, any extra packages specified in the dependencies will be installed, as well as the local package.

Prefix environments

It's possible to identify environment py prefix (the path in the filesytem) rather than by name.

prefix = .venv/

Will create a conda environment in the .venv/ folder. This is useful because a text editor might check for this location to use the virtual environment.



hatch-conda is distributed under the terms of the MIT license.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

hatch_conda-0.5.2.tar.gz (9.4 kB view hashes)

Uploaded Source

Built Distribution

hatch_conda-0.5.2-py3-none-any.whl (6.8 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page