When I installed OpenCV using Homebrew (brew), I got this problem whenever I run this command to test python -c \"import cv2\":
brew
python -c \"import cv2\"
Run
After installing pytorch, I got a similar error when I used:
import torch
Removing NumPy didn't help (I actually renamed NumPy, so I reverted back after it didn't work). The following commands worked for me:
sudo pip install numpy --upgrade sudo easy_install numpy