Installing OpenCV with Conda and Spyder

16,139

Solution 1

Python 3.8 is relatively new. And according to the error it looks like that conda package manager still does not support Python 3.8.

Try downloading using this command:

pip install opencv-python

For a proper guide, refer https://pypi.org/project/opencv-python/

Solution 2

The answer for this issue is updating Anaconda to the newest version:

conda update -n base -c defaults conda

then you can install opencv normally using:

conda install -c conda-forge opencv
Share:
16,139
TejasOS
Author by

TejasOS

Updated on June 13, 2022

Comments

  • TejasOS
    TejasOS almost 2 years

    I'm having trouble installing OpenCV with Conda. I tried running numerous commands, none of which worked. For example, when I ran conda install -c anaconda opencv (as per https://anaconda.org/anaconda/opencv) I get this error:

    UnsatisfiableError: The following specifications were found
    to be incompatible with the existing python installation in your environment:
    
    Specifications:
    
       - opencv -> python[version='>=2.7,<2.8.0a0|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0']
    
    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.
    

    Why is this happening and how can I install OpenCV in Spyder?

    Thanks.

  • TejasOS
    TejasOS over 3 years
    Hi, I tried that, but when I do that I get this error in my Spyder console when I run my program: You might be loading two sets of Qt binaries into the same process. Check that all plugins are compiled against the right Qt binaries. Export DYLD_PRINT_LIBRARIES=1 and check that only one set of binaries are being loaded. QObject::moveToThread: Current thread (0x7fa116b51ec0) is not the object's thread (0x7fa116946910). Cannot move to target thread (0x7fa116b51ec0)
  • TejasOS
    TejasOS over 3 years
    Also, it looks like on this site that Anaconda Navigator does support Python 3.8: anaconda.com/products/individual
  • Shrey Shah
    Shrey Shah over 3 years
    If it supports Python 3.8, then try ```conda update --all" and then try the conda installation.
  • Shrey Shah
    Shrey Shah over 3 years
    Also I degrading to python 3.7 would also be a good idea not only for this package, but it would support many other packages as well.
  • TejasOS
    TejasOS over 3 years
    Okay, I'll do that. Thanks