If you forget to copy the original error message, the content is similar to:
>>> import cv2
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File
"/Users/xxx/Anaconda/anaconda/envs/python35/lib/python3.5/site-packages/cv2/__init__.py", line 4, in <module>
from .cv2 import *
ImportError: dlopen(/Users/xxx/Anaconda/anaconda/envs/python35/lib/python3.5/site-packages/cv2/cv2.cpython-35m-darwin.so, 2): Library not loaded: /System/Library/Frameworks/CoreImage.framework/Versions/A/CoreImage
Referenced from: /Users/xxx/Anaconda/anaconda/envs/python35/lib/python3.5/site-packages/cv2/.dylibs/libavcodec.57.107.100.dylib
Reason: image not found
>>> `
The breakthrough is also in the error report, which indicates that the libavcodec library may be missing or have problems. The solution is to install the library
Specific:
$ brew install libav
$ brew install ffmpeg
Read More:
- Python Import Error: SystemError: Parent module ‘‘ not loaded, cannot perform relative import
- Import CV2 & Numpy report red Warning and Error [How to Solve]
- Import win32API; importerror: DLL load failed: the specified program was not found
- [Solved] torchvision Error: UserWarning: Failed to load image Python extension: Could not find module
- import statsmodels.api as sm Error: ImportError: DLL load failed while importing _arpack: The specified program could not be found.
- [Solved] Python Image Library fails with message “decoder JPEG not available” – PIL
- [Solved] cv2.xfeatures2d.SIFT_create() Error: module ‘cv2.cv2’ has no attribute ‘xfeatures2d’
- [Solved] Import cv2 Error: ImportError: libGL.so.1: cannot open shared object file: No such file or directory
- [Solved] R Error: Python module tensorflow.keras was not found.
- [Solved] cv2.error: OpenCV(4.6.0) D:\a\opencv-python\opencv-python\opencv\modules\……
- How to Solve Python ImportError: cannot import name UnrewindableBodyError
- [Solved] gyp verb `which` failed Error: not found: python2
- [Solved] cv2.error: (-215:Assertion failed) encoder->isFormatSupported(CV_8U) in function ‘imwrite_‘
- [Solved] OpenCV Import Error: ImportError: numpy.core.multiarray failed to import
- [Solved] Python Project Import Module Error: ModuleNotFoundError
- [Solved] python3.10 Error: cannot import name ‘Iterable‘ from ‘collections‘
- Keras import package error: importerror: cannot import name ‘get_ config‘
- Python 3 uses the relative path import module
- Solve the problem of error reporting from scipy.misc import imread & imresize in Python