Bug: Python+VSCode-Module 'cv2' has no 'imshow' member

今天在VSCode中使用python的cv2模块,虽然程序正常运行,可是代码中cv2下方有红色波浪线报错,内容是“Module ‘cv2’ has no ‘imshow’ member”

解决方案

在VSCode中打开 文件->首选项->设置,在搜索设置中输入 pylintArgs,在settings.json中编辑,把 “python.linting.pylintArgs”: ["–generate-members"] 写入到右侧用户设置中即可。

参考链接:
https://www.jianshu.com/p/ab72e830b2a9
https://www.bilibili.com/video/av33693850/

发布了52 篇原创文章 · 获赞 4 · 访问量 2162

猜你喜欢

转载自blog.csdn.net/qq_42191914/article/details/103369317