I was writing a python program in Visual Studio Code. It is a story that a red line appears in the code when using the OpenCV library.
Module 'cv2' has no 'imread' member
MacOS Catalina Visual Studio Code 1.39.2 python 3.8.5 opencv-python 4.4.0
By the way, cv2 is included. Let's first make sure it's not an error here.
import cv2
If you get an error with this sentence, cv2 is not included. Do the following in your terminal:
$brew install opencv
$pip install opencv-python
Open VS Code settings. Code -> Preferences -> Settings
After opening the settings, enter the following in the search window above to search.
python.linting.pylintEnabled
Please uncheck the items that appear.
It has disappeared.
The end
Recommended Posts