vscode运行Python出现问题import cv2 ModuleNotFoundError: No module named 'cv2'

import cv2 ModuleNotFoundError: No module named ‘cv2’

vscode运行Python时出现问题

PS D:\bmi\bmi-project> python demo.py
Traceback (most recent call last):
  File "demo.py", line 2, in <module>
    import cv2
ModuleNotFoundError: No module named 'cv2'

解决办法:

PS D:\bmi\bmi-project> python -m pip install opencv-python

输完命令之后就开始安装了
在这里插入图片描述

你可能感兴趣的:(python)