这里写自定义目录标题
针对无法导入cv2模块问题,或者出现ERROR: Could not find a version that satisfies the requirement cv2 (from versions: none)的报错,可以在cmd中输入以下命令:pip3 install opencv,如果还不行,试着在Python的Terminal里面输入:pip3 install opencv-python。等待安装成功就可以了。
C:\Users\admin\PycharmProjects\pythonProject12>pip3 install opencv-python
Collecting opencv-python
Downloading opencv_python-4.5.1.48-cp38-cp38-win_amd64.whl (34.9 MB)
|████████████████████████████████| 34.9 MB 131 kB/s
Requirement already satisfied: numpy>=1.17.3 in e:\python\lib\site-packages (from opencv-python) (1.19.4)
Installing collected packages: opencv-python
Successfully installed opencv-python-4.5.1.48
出现上面的就是安装成功了。