D:\Maindocument\pycharmDemo\venv\Scripts\python.exe D:/Maindocument/pycharmDemo/opencv_人脸是被.py
Traceback (most recent call last):
File "D:/Maindocument/pycharmDemo/opencv_人脸是被.py", line 4, in <module>
import cv2
ModuleNotFoundError: No module named 'cv2'
Process finished with exit code 1
- 在安装opevncv时会出现 ImportError: No module named cv2 的错误,找不到cv2的包。
- 意思是找不到这个模块
- 我们在命令行进行此模块的安装即可
- pip install opencv-python
- 或者可以在pycharm中进行安装,file->setings->ProjectLpycharmDemo->Project Interpreter 中找到pip 然后双击鼠标左键,会出现一个搜索框
- 然后点击 Install Package即可