Cv2 problem in binder

I have a problem with cv2 which stops me from building a binder. I saw some discourse here, and tried to copy examples to make my own binder work, but it will not. I get errors:

ERROR: Could not find a version that satisfies the requirement opencv (from cleanx)
ERROR: No matching distribution found for opencv

Any ideas?

Please if you are referring to some discussion here on this site, link to it so we know what you mean, and so you and others can find it later.

Also, it’s a good idea to link to your repository so that we can better help you & faster.
I think I found what you are working on here. However, in regards to cv2 use it doesn’t seem to follow any of the examples I’ve linked to in the past, and so maybe you found other examples that work with Binder? All the more reason to link what you are using as a guide here. Are you using opencv-python-headless? See https://github.com/fomightez/gel_image_annotation/blob/1d1dded1777a3e9b7bac36eea60f32bbf4505e87/requirements.txt for an example.
All other stuff I noted here, uses opencv-python or opencv-contrib-python in the configuration file.


However, more importantly for now is that your current directory hierarchy in your cleanX repo is incompatible with Binder. You need to put your configuration files either in the root directory of you repo, i.e.here or in a subdirectory named binder (or .binder) that is in the root directory of the repo, see here or here for that being pointed out in the documentation.

1 Like

Thank you very much. One problem is solved. I went through your previous comment and had tried putting the open cv in the requirements.txt every way I saw you did it before, and none had worked. I did make a separate folder to see if it worked, and started trying all the possibilities all over again, and some seem to work now…but now I have the same type of problem with the PIL library, which I was using version 8.3.0 of…

And you have the same type of issue. You aren’t putting the correct thing in requirements.txt. You can think of requirements.txt as a list of packages that it is going to use pip install to install. And so you want to put what the Python Package Index (PyPi) says for installing via pip. If you go here, you’ll see in the upper left the Python Imaging Library is installed with pip install Pillow and so you put Pillow in requirements.txt. I know for this package that it is not case sensitive, and so pillow works, too.


As an aside, you only need to put the configuration files in the binder folder. I see you have notebooks and some data in there too now. If you already had those elsewhere, you don’t need to duplicate it. You can direct the launch via the URL. And by default, the launched sessions starts out with the working directory being root, I believe. Even if you have a binder subdirectory.

Thank you so much for all your help.