回溯(最近一次调用最后一次):文件“”,第 1 行,ImportError:没有名为“cv2”的模块如何修复此错误
答案1
看起来您还没有python-opencv
安装。您可以尝试以下操作:
$ sudo apt-get install python-opencv
答案2
似乎 Python 没有找到 opencv 模块 (cv2.so),请尝试:
echo /usr/local/opt/opencv/lib/python2.7/site-packages >> /usr/local/lib/python2.7/site-packages/opencv3.pth
echo /usr/local/opt/opencv/lib/python3.7/site-packages >> /usr/local/lib/python3.7/site-packages/opencv3.pth