Conda: error: unrecognized arguments: environment.yml

Hi All!

I’m trying to set-up Binder with one of my projects, however I’m getting an error I’ve never seen before when using Binder

Waiting for build to start...
Picked Git content provider.
Cloning into '/tmp/repo2docker3gdg2qgt'...
HEAD is now at 47f3335 added further documentation
Using DockerBuildPack builder
Step 1/7 : FROM continuumio/miniconda3:latest
 ---> 52daacd3dd5d
Step 2/7 : COPY environment.yml .
 ---> Using cache
 ---> 1a85966d3b40
Step 3/7 : COPY satip /satip
 ---> Using cache
 ---> 8872a596e226
Step 4/7 : COPY setup.py .
 ---> Using cache
 ---> aef8dae7247f
Step 5/7 : RUN conda create env -f environment.yml
 ---> Running in 0261c718bb79
usage: conda [-h] [-V] command ...
conda: error: unrecognized arguments: environment.yml

The environment.yml that I’m trying to install is quite a large one, however it works fine for fresh installs locally.

name: satip_dev

channels:
  - conda-forge
  - coecms
  
dependencies:
  - python>=3.7
  - pytest
  - pytables
  - pandas
  - matplotlib
  - jupyterlab
  - ipympl
  - nodejs
  - satpy
  - netCDF4
  - xarray
  - cartopy
  - pyproj
  - pyinterp
  - geopandas
  - rasterio
  - pillow  
  - gdal
  - tabulate
  - python-dotenv
  - xmltodict
  - dataset
  - seaborn
  - mkdocs-material
  - twine
  - gcsfs
  - zarr
  - dagster
  - dagit
  - mkdocs
  - mkdocs-material
  - pip
  
  - pip:
      - -e .
      - dagster-airflow
      - nbdev
      - ipypb
      - feautils
      - slack-logger
      - mkdocs-material-extensions
      - mkdocstrings
      - google-cloud-storage
      - configparser
      - pandas_gbq
      - junix

The repository I’m trying to install from is here. Any advice on how I can fix this would be appreciated.

That repository contains a Dockerfile which overrides anything BinderHub and repo2docker will do:

in other words the error you’re seeing is due to the Dockerfile, and is nothing to do with BinderHub. In general this isn’t something we recommend as it can be difficult to ensure the Dockerfile contains all the dependencies required to work with BinderHub, see https://mybinder.readthedocs.io/en/latest/tutorials/dockerfile.html for more information.

1 Like

@manics pointed out what is happening. One idea that you could test would be to make a sub-directory named binder in your root directory, see here, and copy the environment.yml you have to there. Then that will be used by Binder to build the image from the repo and if you environment.yml specifies everything needed, it should work. Additionally that allows you to not mess with your files in the main directory of your repo and avoids the Dockerfile use which is trickier.