vscode cv2 intellisense

先安装mypy

pip install mypy

然后切换目录到site-packages

cd /home/xxx/anaconda3/envs/mmyolo/lib/python3.8/site-packages

然后生成.pyi文件

stubgen -m cv2 -o $(python -c 'import cv2, os; print(os.path.dirname(cv2.__file__))')

在vscode的settings.json添加搜索路径

    "python.analysis.extraPaths": [
        "/home/xx/anaconda3/envs/mmyolo/lib/python3.8/site-packages/cv2"
    ],
posted @ 2024-07-23 10:28  骏腾  阅读(5)  评论(0编辑  收藏  举报