I have a fairly simple Jupyter repo which I’m looking at again after a period of neglect. The last time I looked at this project, the requirements as of this commit were sufficient for Binder to serve my notebook, however this no longer seems to work. Could anyone offer advice as to how to start to debug this sort of problem?
Note, the most recent requirements.txt in the repo features explicit package versions, which I recently updated (and seem to be sufficient for running a Jupyter notebook locally, and also running the Python app included as part of the repo), but these also don’t seem to play well with Binder.
The log of the build from mybinder.org is very clear:
ERROR: Could not find a version that satisfies the requirement opencv-python-headless==4.2.0.34 (from versions: 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.15.55, 3.4.16.59, 3.4.17.61, 3.4.17.63, 3.4.18.65, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.3.56, 4.5.4.58, 4.5.4.60, 4.5.5.62, 4.5.5.64, 4.6.0.66, 4.7.0.68, 4.7.0.72, 4.8.0.74, 4.8.0.76, 4.8.1.78, 4.9.0.80)
ERROR: No matching distribution found for opencv-python-headless==4.2.0.34
As it stands, what you have is quite the opposite of a ‘fairly simple’ repo.
As you point out, you pinned a number of dependencies there and are overlapping with infrastructure that mybinder needs to set itself.
Luckily, there is an easy solution to this. You can leave the requirements.txt that you have in root that specifies things you want to use for local & app and as a record of the packages that played well in your local installation as part of that app. What you want to do is set up an alternative requirements.txt that is just for MyBinder to use. You can do that in a new directory you’ll make in the root of your repo. The new directory has to be named binder, see here. The BinderHub build system will look for configuration files in the binder directory first and if it finds them it ignores anything in the root. That way you can leave your situation in root as it stands, but configure your MyBinder build specifically. You want to have in the binder directory only the packages you need to install when you launch from here and try to run your notebooks there, and to ideally specify no versions, like you seemed to have had in the past there in that old commit.
For the record:
A. Your old one still builds, try here. However, for now it is failing to launch. I don’t understand quite why though. It may be something you cannot control in the system as I don’t see it pushing the image after the build. It may a temporary glitch in the system (again, in a part you have no control over). I don’t know. Hopefully it is moot because you want to use the updated version anyways; however, it would give you another point of information about what works in the configuration files.
B. Upon triggering build right now, I see:
ERROR: Could not find a version that satisfies the requirement opencv-python-headless==4.2.0.34 (from versions: 3.4.10.37, 3.4.11.39, 3.4.11.41, 3.4.11.43, 3.4.11.45, 3.4.13.47, 3.4.15.55, 3.4.16.59, 3.4.17.61, 3.4.17.63, 3.4.18.65, 4.3.0.38, 4.4.0.40, 4.4.0.42, 4.4.0.44, 4.4.0.46, 4.5.1.48, 4.5.3.56, 4.5.4.58, 4.5.4.60, 4.5.5.62, 4.5.5.64, 4.6.0.66, 4.7.0.68, 4.7.0.72, 4.8.0.74, 4.8.0.76, 4.8.1.78, 4.9.0.80)
The allowed options for opencv-python-headless versions are listed there and don’t match your setting. Hopefully this also becomes moot, too, with the new direction.
Thank you @fomightez for the thorough response! It is very much appreciated.
Yes, I should have been more specific when I described it as a simple repo: as you point out, it is currently trying to do several things at once from a configuration point of view.
I did actually wonder if the failure to launch was transient when I tried rolling back the requirements to the “old” way.
I will follow your suggestion of creating a ./binder/requirements.txt and will see what happens.