Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Installing OpenCV with Conda and Spyder

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.

like image 514
TejasOS Avatar asked Jul 31 '20 17:07

TejasOS


People also ask

How do I install cv2 on anaconda Spyder?

Step 1:- After installing the anaconda open the Anaconda Prompt. Step 2:- Type the given command, press enter, and let it download the whole package. Step 3:- Now simply import OpenCV in your python program in which you want to use image processing functions.

Can you install OpenCV with Conda?

With anaconda 3, type conda install opencv command on annaconda prompt. Installs 3.4. 1 opencv and various dependent packages with it. Worked for me and also it did not require any custom installing specification.

How can I download cv2 in Conda?

Use the Anaconda Navigator to Install the OpenCV Module From there, select the Not Installed option of packages and find the module, or just type in opencv in the search packages search bar.

How do I install Python OpenCV through Conda?

Possible duplicate of How do I install Python OpenCV through Conda? Use conda install -c conda-forge opencv. Or better, create a new env for it and let Conda resolve the Python version that's best for it: conda create --name env_name -c conda-forge opencv

How to run OpenCV library in Anaconda?

Step 1:- Search Anaconda in your task bar and select ANACONDA NAVIGATOR. Step 2:- Now you will see a menu with various options like Jupiter notebook , Spyder etc. This is Anaconda Environment. Step 3:- Select Spyder as it is Anaconda’s IDE for python and OpenCV library will work in it only.

How to install Anaconda in skyder?

Spyder (sub-application of Anaconda) is used for python.Opencv for python will work in skyder. Package versions are managed by the package management system conda. Installing Anaconda : Head over to continuum.io/downloads/ and install the latest version of Anaconda.

What is the difference between Anaconda and Spyder?

ANACONDA Anaconda is a open source software that contains jupiter, spyder etc that are used for large data processing, data analytics, heavy scientific computing. Anaconda works for R and python programming language. Spyder (sub-application of Anaconda) is used for python.Opencv for python will work in skyder.


2 Answers

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
like image 66
quangbk2010 Avatar answered Nov 15 '22 21:11

quangbk2010


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/

like image 30
Shrey Shah Avatar answered Nov 15 '22 21:11

Shrey Shah