1
votes

I get the following error when trying to import cv2. I installed opencv-python using pip, and also using homebrew, but I keep getting this issue. Additional info: I'm working on OSX 10.10.5, python3.6 and sublimeText3.

from .cv2 import *                 

ImportError: dlopen(/Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cv2/cv2.cpython-36m-darwin.so, 2): Library not loaded: /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage
Referenced from: /Library/Frameworks/Python.framework/Versions/3.6/lib/python3.6/site-packages/cv2/.dylibs/libavcodec.57.107.100.dylib
Reason: image not found

Does anyone know why the machine can't find this CoreImage, and how I can change it?

1
shouldn't it be from cv2 import * ?? also, normally you do import cv2 to work with opencvapi55
hey thx for your respons, but that is acutally the code i am running, the error message includes the period, but I run import cv2. Any other ideas?Yuri
Also i forgot to mention that i'm working on a virtualenv that might make a difference too?Yuri

1 Answers

0
votes

Try: from cv2 import *

Notice no . before cv2.

OpenCV is a pretty large library so it would probably make more sense to just have import cv2 as it might get confusing if your code gets quite long.