pas*_*sha 19 opencv python-3.x
我 pip 安装了 OpenCV-python。安装似乎没问题,我在 python IDLE 上对其进行了测试。它运行没有任何问题。我一直在尝试在 VS Code 上运行它,但它似乎不起作用。自动完成功能识别 imread 函数,但是当我输入它时,它抛出一个错误,说 cv2 没有 imread 成员。我正在使用最新版本的python
我这样称呼它:img2 = cv2.imread("C:\Biometric\min.jpg", 0)
Ami*_*raj 53
由于您尝试使用 VS Code 执行此操作,请尝试执行以下步骤
(1) open palette on VS Code (use specifies command): CTRL + Shift + P
(2) then select "Preferences: Open Settings (JSON)" option in the palette dropdown
(3) then add the following line in the opened "settings.json" file
"python.linting.pylintArgs": ["--generate-members"]
Run Code Online (Sandbox Code Playgroud)
这必须工作
Nev*_*mba 39
我尝试了很多黑客。他们没有工作。有人建议:
from cv2 import cv2
Run Code Online (Sandbox Code Playgroud)
我认为这是解决此问题的最佳方法
"python.linting.pylintArgs": ["--generate-members=cv2.*"]
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
31897 次 |
| 最近记录: |