Failing to find default/win-64 packages

Hello Binder community! I am attempting to create a binder for my GitHub repository: https://github.com/mmorphew/UNet_Remote_Sensing. I created an environment.yml file using Binder’s example for Anaconda environments. https://github.com/binder-examples/conda

I am running Python 3.8 via Anaconda x64 on Windows 10 64-bit OS. When attempting to create the Binder, I receive this error on step 41/51.

Step 41/51 : RUN conda env update -p {NB_PYTHON_PREFIX} -f "environment.yml" && conda clean --all -f -y && conda list -p {NB_PYTHON_PREFIX}

  • —> Running in 368fdaee001d*
    Collecting package metadata (repodata.json): …working… done
    Solving environment: …working… failed

ResolvePackageNotFound:

    • defaults/win-64::zlib==1.2.11=h62dcd97_4*
      …so and so forth…
    • defaults/win-64::pyreadline==2.1=py38_1*
    • defaults/win-64::libspatialindex==1.9.3=h33f27b4_0*
    • defaults/win-64::zope.interface==4.7.1=py38he774522_0*
    • defaults/win-64::zope.event==4.4=py38_0*

Removing intermediate container 368fdaee001d
The command ‘/bin/sh -c conda env update -p {NB_PYTHON_PREFIX} -f "environment.yml" && conda clean --all -f -y && conda list -p {NB_PYTHON_PREFIX}’ returned a non-zero code: 1

I tried removing these packages from the environment.yml as I thought they were OS-specific packages that Binder did not need. Binder does construct when these packages are removed, but the notebooks will not run without them. For example, opencv is now missing.

I apologize if this is a simple question: it’s my first time using Binder and I can’t find anyone else with this same error. I would greatly appreciate any help or direction on this matter.

Thank you!

A MyBinder session runs on a Ubuntu linux machine and so lines like the following are going to cause problems.

prefix: C:\Users\mdmor\anaconda3\envs\tensorflow-env

You need to clean your environment.yml file to not be OS-specific, see here. Plus, it needs to be ‘Binder-compatible’ and that line above, I don’t think is compatible.
I’d also suggest simplifying the lines you use. Taking the example for zlib , it should just list zlib and not defaults/win-64::zlib==1.2.11=h62dcd97_4. It will then result in something that looks more like here when your environment.yml gets used by conda. You ultimately could include the version if that is important, too. However, to just get it working first you may want to try without specifying the version for now.

If you prefer to keep this repo working for both Windows and Binder, the easier way to go is to create a directory called binder or .binder and put the environment.yml that Binder will use in there. Leave the one you’ll want for your Windows system in the root directory. See here for more about that sort of configuration approach.

Thank you for your help fomightez. Is there anyway to exclude OS specific packages automatically, or to put it another way, is there a way for conda to automatically generate a binder-friendly environment.yml file when using Windows? I thought that using the –from-history command line argument would take care of that. Otherwise it sounds like it might be a much simpler process to simply create the envrionment.yml file manually.

Hopefully someone else can chime in on that question. I’ve only done it manually.

If this answer is correct and that is already what you have using —from-history, then I think you need to manually edit at this point.