天天看点

module ‘cv2‘ has no attribute ‘cvtColor‘

module 'cv2' has no attribute 'xxxx'

关于这个问题,好像是因为opencv-python版本的问题,我原来opencv-python的版本是

opencv_python==4.1.2.30      

我卸载了,然后换成了

opencv_python==4.2.0.34,这样就可以了。      

在这里我提一下关于pycharm的包的问题,你在创建新项目的时候,如果项目接近的话,可以继承全站的包,这样比较方便。

module ‘cv2‘ has no attribute ‘cvtColor‘
module ‘cv2‘ has no attribute ‘cvtColor‘
下一篇: 五 天 后 见