"python.jediEnabled" set to; more info microsoft/vscode-python#3977): Tried bothpython.languageServer setting: XXXOpenCV 3.4.9 built from source with CUDA support and non-free packages, installed in /usr/local.
/usr/local/lib , /usr/local/lib/python2.7/dist-packages and /usr/local/lib/python2.7/site-packages are added to "python.autoComplete.extraPaths"
Autocomplete suggestions for module cv2 are expected.
Autocomplete works in PyCharm IDE, so that proves nothing wrong with my installation of OpenCV.
The only suggestions I get :

i have the same issue but i use python 3.7.5
Created a symbolic link in /usr/local/python2.7/site-packages to the cv2.so file that is in /usr/local/python2.7/dist-packages/cv2.
Added /usr/local/python2.7/site-packages to the python.autocomplete.extraPaths setting and it seems to have solved the problem.
Created a symbolic link in /usr/local/python2.7/site-packages to the cv2.so file that is in /usr/local/python2.7/dist-packages/cv2.
Added /usr/local/python2.7/site-packages to the python.autocomplete.extraPaths setting and it seems to have solved the problem.
How can i do that on Windows?
@t31060 execute the following command with administrator priviledges (change the name of the *.pyd file in both locations)
mklink "<python_dir>\Lib\site-packages\cv2.cp39-win_amd64.pyd" "<python_dir>\Lib\site-packages\cv2\python-3.9\cv2.cp39-win_amd64.pyd"
This should then output
symbolic link created for <python_dir>\Lib\site-packages\cv2.cp39-win_amd64.pyd <<===>> <python_dir>\Lib\site-packages\cv2\python-3.9\cv2.cp39-win_amd64.pyd
@t31060 execute the following command with administrator priviledges (change the name of the *.pyd file in both locations)
mklink "<python_dir>\Lib\site-packages\cv2.cp39-win_amd64.pyd" "<python_dir>\Lib\site-packages\cv2\python-3.9\cv2.cp39-win_amd64.pyd"
This should then output
symbolic link created for <python_dir>\Lib\site-packages\cv2.cp39-win_amd64.pyd <<===>> <python_dir>\Lib\site-packages\cv2\python-3.9\cv2.cp39-win_amd64.pyd
still no autocompletion after doing that, is there something else i must do while building opencv from source to get the auto completion?
@t31060 execute the following command with administrator priviledges (change the name of the *.pyd file in both locations)
mklink "<python_dir>\Lib\site-packages\cv2.cp39-win_amd64.pyd" "<python_dir>\Lib\site-packages\cv2\python-3.9\cv2.cp39-win_amd64.pyd"
This should then output
symbolic link created for <python_dir>\Lib\site-packages\cv2.cp39-win_amd64.pyd <<===>> <python_dir>\Lib\site-packages\cv2\python-3.9\cv2.cp39-win_amd64.pydstill no autocompletion after doing that, is there something else i must do while building opencv from source to get the auto completion?
The response was meant for
How can i do that on Windows?
creating a symbolic link. Not to fix the auto-completion issue with VS Code. Sorry to give false hope :D.
It seems that the Python language servers from Microsoft not necessarily support that.
The current one used is Pylance as far as I know. You can check which one you are using in the settings under Python: Language Server
Pylance does not support auto-completion from *.pyd files according to https://github.com/microsoft/pylance-release/issues/70.
It would only work if you create a stub file *.pyi. I don't know how to do that with OpenCV code or from a *.pyd file.
python-language-server similar discussion at https://github.com/microsoft/python-language-server/issues/1125, not sure what the conclusion should be, it should work?
But when I switched Python: Language Server to Jedi it showed autocompletion for cv2. Even though VS Code automatically set the setting back to Microsoft...
So maybe this works for you.
My current environment is
Version: 1.55.0 (user setup)
Commit: c185983a683d14c396952dd432459097bc7f757f
Date: 2021-03-30T16:01:55.261Z
Electron: 11.3.0
Chrome: 87.0.4280.141
Node.js: 12.18.3
V8: 8.7.220.31-electron.0
OS: Windows_NT x64 10.0.19042
Python Extension: ms-python.python v2021.3.680753044