I am trying to install opencv on a mac 10.11. I have tried with pip, pip3, conda, brew with no luck. I also tried creating an environment with virtualenv again with no luck, that said, I am a complete newbie so I don't know if I did this the right way. I tried many versions of opencv from 3 to the newest one.
Homebrew is installed on my machine, however, I don't have xcode (only command tool line) as I cannot get a version compatible with my mac. I don't want to list all of the error messages I get when trying to install with brew, pip etc so, below is the message I get when trying with conda. I know that this question has been asked in different versions several times so far, however, i was not able to get things done by looking at this community. I would appreciate any advice.
(env) (base) dims-mbp:my_project dimkoun$ conda install --channel https://conda.anaconda.org/menpo opencv3
Collecting package metadata (current_repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: failed with repodata from current_repodata.json, will retry with next repodata source.
Collecting package metadata (repodata.json): done
Solving environment: failed with initial frozen solve. Retrying with flexible solve.
Solving environment: |
Found conflicts! Looking for incompatible packages.
This can take several minutes. Press CTRL-C to abort.
failed
UnsatisfiableError: The following specifications were found
to be incompatible with the existing python installation in your environment:
Specifications:
- opencv3 -> python[version='2.7.*|3.4.*|3.5.*']
Your python: python=3.8
If python is on the left-most side of the chain, that's the version you've asked for.
When python appears to the right, that indicates that the thing on the left is somehow
not available for the python version you are constrained to. Note that conda will not
change your python version to a different minor version unless you explicitly specify
that.
CodePudding user response:
It seems you are trying to install old version (v3.1.0) of opencv3 that only knew Python 3.5.*.
CodePudding user response:
As Marcin Orlowski mentioned, the version of OpenCV in the menpo
repo is severely out of date. However, conda-forge
contains a very recent version, 4.5.3, and has both OSX/arm64 and OSX/x_64 versions. Just run
conda install -c conda-forge opencv
and you should be all set.
CodePudding user response:
Don't install OpenCV from conda. None of those packages are official and many are horribly outdated. Even the ones in conda-forge lag behind by 6 months.
Instead, install opencv-python
(xor a sibling package like opencv-contrib-python
) from PyPI. that's the official package.
pip3 install opencv-python