前言
解决 ModuleNotFoundError: No module named ‘cv2’?
ModuleNotFoundError: No module named ‘cv2’?
1. 安装 opencv-python:
pip install opencv-python -i https://pypi.tuna.tsinghua.edu.cn/simple/
2.出现错误
ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed directly
3. 更新setuptools
pip install --upgrade pip setuptools wheel
4. 出现错误
ERROR: Could not build wheels for opencv-python, which is required to install pyproject.toml-based projects
5. python和opencv版本不匹配
Python3.6适配的opencv版本是opencv-python 4.5.4.60
pip install opencv-python==4.5.4.60
参考网页
Numpy和OpenCV库匹配及下载方法指南–pycharm
ERROR: Could not build wheels for opencv-python which use PEP 517 and cannot be installed d