0

I am a beginner in terms of using python. Currently, I got python 3.7 and I am using anaconda as IDE. For my project, I need to detect the location and brightness of points/dots in an external imported picture. I figure I could use the modul OpenCV. Unfortunately, I am stuck right now with the problem to import the module cv2. I already successfully installed the package using

python -m pip install OpenCV-python

on command prompt. OpenCV Version which was installed is 4.2.0.34. While compiling the test script of OpenCV on Spyder

import cv2
print(cv2.__version__)

I got this message

"ImportError : DLL load failed : The Modul was not found." 

Can somebody let me know please how to fix this problem? Is somehow the version of OpenCV I got not compatible with the Python version? I already watched and followed many tutorial videos on Youtube, but I couldn't find the solution. I tried to copy the cv2.pyd to the site-packages folder in

C:/user/Anaconda3/Lib/site-packages directory

still it didn't fix the problem...

I would appreciate any answers and help I could get here. Thank you!

2
  • Are you on the correct virtual environment? Have you created a virtual environment other than base? To see a list of enviroments use conda info --envs in terminal, and you should read this to understand conda/enviroments better. link Commented Jun 2, 2020 at 19:08
  • i never changed the environment, or create one. On the list of the environments, there's no opencv or cv2. Commented Jun 2, 2020 at 23:15

2 Answers 2

1

try installing it using these commands in the following order:

conda update anaconda-navigator
conda update navigator-updater
pip install opencv-python

It should work fine.

Sign up to request clarification or add additional context in comments.

Comments

0

Try conda install opencv or conda install -c menpo opencv

2 Comments

i tried both commands on Anaconda prompt. still didn't work :(
Did you activate your environment? Otherwise you can also install with pip, though should only be used as last resort in a conda environment stackoverflow.com/questions/41060382/…

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.