E1101:Module 'cv2' has no 'imread' member

asked 2018-10-10 06:31:50 -0600

ZJ gravatar image

Hi, I received the following errors Windows 10 using Microsoft VsCode [Pylint] E1101:Module 'cv2' has no 'imread' memberFor the following line of code For the following line of code img1 = cv2.imread("dog.jpg") / 255.0

edit retag flag offensive close merge delete

Comments

can it be , you have a python file named cv2.py or a folder named cv2 somewhere ?

berak gravatar imageberak ( 2018-10-10 06:39:21 -0600 )edit

try to run your script from a simple cmdline, NOT from VsCode.

berak gravatar imageberak ( 2018-10-11 07:08:54 -0600 )edit

Hey there! I've also met the same problem when using OpenCV on VsCode platform. My solution is to change the import statement to the form below:

from cv2 import cv2

Eventually, cv2 members can be used!

Good luck :)

EDEVA gravatar imageEDEVA ( 2019-05-17 03:21:02 -0600 )edit