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"
],