# CondaEnvException: Unable to determine environment

**URL:** <https://renku.discourse.group/t/condaenvexception-unable-to-determine-environment/959>\
**Category:** RenkuLab\
**Created:** [29 November 2023 17:32 UTC](https://renku.discourse.group/t/condaenvexception-unable-to-determine-environment/959 "2023-11-29T17:32:43Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mrawlik](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/mrawlik/32/546_2.png) [@mrawlik](https://renku.discourse.group/u/mrawlik)\
**Post date:** [29 November 2023 17:32 UTC](https://renku.discourse.group/t/condaenvexception-unable-to-determine-environment/959/1 "2023-11-29T17:32:43Z")

</div>

For some reason the CI pipeline started failing for my project [Reproducible Data Science | Open Research | Renku](https://renkulab.io/projects/stamplab/gict-of-human-breast) with the error:

```auto
#7 [stage-1 3/4] RUN mamba env update -q -f /tmp/environment.yml && /op...
#7 7.070 
#7 7.070 CondaEnvException: Unable to determine environment
#7 7.070 
#7 7.070 Please re-run this command with one of the following options:
#7 7.070 
#7 7.070 * Provide an environment name via --name or -n
#7 7.070 * Re-run this command inside an activated conda environment.
#7 7.070 
#7 ERROR: executor failed running [/bin/bash -c -o pipefail mamba env update -q -f /tmp/environment.yml && /opt/conda/bin/pip install -r /tmp/requirements.txt --no-cache-dir && mamba clean -y --all && mamba env export -n "root" && rm -rf ${HOME}/.renku/venv]: exit code: 1

```

I tried starting from the newest renkulab python-minimal and cuda images. In all cases I get the same error.

I tried locally to run `docker run --rm -it renku/renkulab-cuda:11.8-9d152cc bash`, create the `environment.yml` file in the image, and then run `mamba env update -q -f environment.yml`. This works.

---

<div class="post-metadata">

**Author:** ![rrrrrok](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/rrrrrok/32/117_2.png) [@rrrrrok](https://renku.discourse.group/u/rrrrrok)\
**Post date:** [29 November 2023 17:43 UTC](https://renku.discourse.group/t/condaenvexception-unable-to-determine-environment/959/2 "2023-11-29T17:43:27Z")

</div>

Hi @mrawlik, this sounds like a different symptom, but just to be sure, could you check if the `defaults` channel is included in your `environment.yml` and remove it?

---

<div class="post-metadata">

**Author:** ![mrawlik](https://yyz2.discourse-cdn.com/free1/user_avatar/renku.discourse.group/mrawlik/32/546_2.png) [@mrawlik](https://renku.discourse.group/u/mrawlik)\
**Post date:** [29 November 2023 21:58 UTC](https://renku.discourse.group/t/condaenvexception-unable-to-determine-environment/959/3 "2023-11-29T21:58:57Z")

</div>

It is. `environment.yml` is:

```auto
channels:
  - defaults
  - conda-forge
  - astra-toolbox
dependencies:
  - numpy
  - scipy
  - astra-toolbox
  - tomopy
  - xarray
  - astropy
  - pandas
  - h5py
  - matplotlib
  - scikit-image
  - black
  - papermill

```

Removing `defaults` doesn’t help. It pointed me in the right direction, though! I checked [https://github.com/SwissDataScienceCenter/renku-project-template/blob/master/python-minimal/environment.yml](https://github.com/SwissDataScienceCenter/renku-project-template/blob/master/python-minimal/environment.yml) and I see that there is now a crucial line

```auto
name: "base"

```

Adding this to my `environment.yml` fixed it.

It actually makes sense as `environment.yml` is used with `conda env update` (as opposed to `conda env create`), so I should be clear what environment am I basing myself on.
