To install the OpenCV library for computer vision on macOS, first install the required prerequisites, then the package itself.
pip install scikit-build pip install cmake pip install opencv-python
Test the installation:
python >> import cv2
The import should work without errors.