3

In order to download OpenCV on through Anaconda prompt, I run the following:

conda install -c conda-forge opencv

However, whenever I try to download, there I get the messages of

failed with initial frozen solve. Retrying with flexible solve. Failed with repodata from current_repodata.json, will retry with next repodata source

This would continue as the prompt tries to then diagnose what conflicts there are in my system that could prevent OpenCV from downloading.

I kept my laptop on over night, but when I woke up in the morning, there was still diagnosing for potential conflicts going on. I'm not too sure what to do at this point. I just started trying again, but the same issues are being experienced.

I am trying to download OpenCV so that I can import cv2 to work on machine learning projects for object/image detection.

I have also tried pip install -c anaconda opencv but am having the same issues.

blackraven
  • 5,284
  • 7
  • 19
  • 45
PKrange
  • 111
  • 1
  • 7

1 Answers1

4

Please note that to import cv2, the library/package to install is called opencv-python.

From Jupyter notebook, you can try !pip install opencv-python

If you're using anaconda, you can try conda install -c conda-forge opencv-python

blackraven
  • 5,284
  • 7
  • 19
  • 45
  • I spent around 2 hours swimming in this problem when I was working on my face recognition project https://github.com/JNYH/Face_Recognition – blackraven Jul 31 '22 at 12:42
  • 1
    `conda install -c conda-forge opencv-python` led to the following error for me: PackagesNotFoundError: The following packages are not available from current channels: - opencv-python Current channels: - https://conda.anaconda.org/conda-forge/osx-64 - https://conda.anaconda.org/conda-forge/noarch - https://repo.anaconda.com/pkgs/main/osx-64 - https://repo.anaconda.com/pkgs/main/noarch - https://repo.anaconda.com/pkgs/r/osx-64 - https://repo.anaconda.com/pkgs/r/noarch – xFioraMstr18 Oct 21 '22 at 21:01
  • 1
    will [this answer](https://stackoverflow.com/questions/48493505) help you? Try adding the conda-forge channel to your list of channels with this command: `conda config --append channels conda-forge`. It tells conda to also look on the conda-forge channel when you search for packages. – blackraven Oct 22 '22 at 07:21