Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

intellisense for cv2 is not working #4838

Closed
ukalwa opened this issue Sep 14, 2023 · 2 comments
Closed

intellisense for cv2 is not working #4838

ukalwa opened this issue Sep 14, 2023 · 2 comments
Assignees

Comments

@ukalwa
Copy link

ukalwa commented Sep 14, 2023

cv2 intellisense seemed to have stopped in the latest releases. I don't see cv2 stubs bundled in vscode server pylance extension
/root/.vscode-server/extensions/ms-python.vscode-pylance-2023.9.10/dist/bundled/native-stubs as I only see lxml, pandas and numpy in there. This was also not documented in the CHANGELOG.md of pylance-release so I assume it is a bug.

I tried both opencv-python and opencv-python-headless and the issue was the same. Then I came across this issue comment where it said that typings are bundled by pylance and that's when I knew it was a pylance issue.

I encountered the same issue even in pylance pre-release version (2023.9.12)

Repro Steps

  • Install opencv by running pip install opencv-python==4.7.0.72

image

Environment data

  • Language Server version: 2023.9.10
  • OS and version: Host OS - Mac M1, Devcontainer - Ubuntu 22.04 on aarch64
  • Python version (& distribution if applicable, e.g. Anaconda): 3.10.12

Expected behavior

intellisense should work for cv2

Actual behavior

It used to work but it doesn't anymore

@github-actions github-actions bot added the needs repro Issue has not been reproduced yet label Sep 14, 2023
@debonte debonte assigned debonte and unassigned rchiodo Sep 14, 2023
@debonte
Copy link
Contributor

debonte commented Sep 14, 2023

The cv2 stubs were removed intentionally because opencv-python now ships their own stubs. You can get them by upgrading to opencv-python 4.8.0.76.

If you need our old cv2 stubs, you can get them from https://github.com/microsoft/python-type-stubs. microsoft/python-type-stubs@1add739 was the last commit before they were removed.

Apologies for not mentioning this in the changelog.

@debonte debonte closed this as completed Sep 14, 2023
@debonte debonte added by design and removed needs repro Issue has not been reproduced yet labels Sep 14, 2023
@ukalwa
Copy link
Author

ukalwa commented Sep 14, 2023

Ah, ok. That makes sense and thanks for the quick response.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants