Skip to content

Instantly share code, notes, and snippets.

@gavinb
Last active June 22, 2020 06:03
Show Gist options
  • Save gavinb/66e915727b0ce84165d781e3dcac519c to your computer and use it in GitHub Desktop.
Save gavinb/66e915727b0ce84165d781e3dcac519c to your computer and use it in GitHub Desktop.
Solve problem installing OpenCV under Anaconda Python

Using Anaconda's distribution of Python for SciPy on Windows 10

Trying to install OpenCV support according to the official page:

https://anaconda.org/conda-forge/opencv

conda install -c conda-forge opencv

fails with the following error:

Solving environment: failed with initial frozen solve. Retrying with flexible solve.

which ultimately fails.

This seems to be a common problem:

conda/conda#9367

however the solutions offered either do not fix the problem, are hacky workarounds or voodoo.

The clean work-around found to be successful was, immediately after the install, to "update" to an anaconda "metapackage", which are a collection of packages that have been tested to work together. Firstly update conda itself:

conda update conda

Then update the anaconda metapackage, which actually DOWNGRADES python to a custom version, but then you get no clashes:

conda update anaconda

Then you can install opencv:

conda install opencv

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment