0
votes

I just Installed the latest Anaconda 3.8.3 with conda version 4.8.3 right away after I installed Anaconda, I use Jupyter Notebook then type

import cv2

it says

ModuleNotFoundError Traceback (most recent call last) in ----> 1 import cv2

ModuleNotFoundError: No module named 'cv2'

then based on : Cannot find module cv2 when using OpenCV

someone suggested trying

conda install -c https://conda.binstar.org/menpo opencv

from the Anaconda Prompt

prompt result

Is there any other way to install cv2?

4
Try pip install opencv in corresponding conda env - Sociopath
conda install -c conda-forge opencv - Nirmal
I tried pip install opencv and conda install -c conda-forge opencv and still failed with the same result @Sociopath and @nirmal - AmandaKamphoff
You need to be an administrator to install packages with your current setup. You should launch the Anaconda Prompt in Administrator mode. If you don't know how to do that, it would probably be best to uninstall and re-install Anaconda, clicking the box to install it only for your own user account. - darthbith

4 Answers

1
votes

Just open your command prompt with run as administrator. And try,

conda install -c conda-forge opencv

1
votes

I was getting this error when using the command conda install -c menpo opencv

Specifications:

  • opencv -> python[version='2.7.*|>=3.5,<3.6.0a0|>=3.6,<3.7.0a0|>=3.7,<3.8.0a0'] Your python: python=3.8 .So,by using pip it got solved.
pip install opencv-contrib-python
0
votes

Did you try:

pip install opencv-python

This one works on MacOS and Windows.

0
votes

If I understand you correctly, you may be able to solve the problem with this command.

 pip install opencv-python

If not, I think maybe the virtual environment is set up incorrectly. Make sure the package is installed on the appropriate interpreter.