I'm trying to figure out why does the autocomplete for cv2
package is not working properly. Below some information about issue and versions that I'm using and my attempts to solve it:
Autocomplete in VS Code
Versions information
- opencv-python: 4.4.0.46
- jedi: 0.17.2
- numpy: 1.19.4
All 3 packages above are installed at C:\...\anaconda3\lib\site-packages
- Visual Studio Code: 1.50.1
- Python extension: v2020.10.332292344
- Python version: 3.8.3
My attempts
I've checked whether my packages are installed in default location, suggested by this question with no success. They are installed at default location and still not working.
The command line
print(jedi.Script("import cv2\ncv2.").completions())
brings me the auto-completion correctly when I execute it in PowerShell, as recommended in this issue, but still not working in VS Code. Result are below:
PS: I've limited the output because questions have a limitation regarding number of characters, can't bring them all.
>>> print(jedi.Script("import cv2\ncv2.").completions())
<stdin>:1: DeprecationWarning: Deprecated since version 0.16.0. Use Script(...).complete instead.
[<Completion: >, <Completion: absdiff>, <Completion: ACCESS_FAST>, <Completion: ACCESS_MASK>, <Completion: ACCESS_READ>, <Completion: ACCESS_RW>, <Completion: ACCESS_WRITE>, <Completion: accumulate>, <Completion: accumulateProduct>, <Completion: accumulateSquare>, <Completion: accumulateWeighted>, <Completion: ADAPTIVE_THRESH_GAUSSIAN_C>, <Completion: ADAPTIVE_THRESH_MEAN_C>, <Completion: adaptiveThreshold>, <Completion: add>, <Completion: addText>, <Completion: addWeighted>, <Completion: AffineTransformer>, <Completion: AGAST_FEATURE_DETECTOR_AGAST_5_8>, <Completion: AGAST_FEATURE_DETECTOR_AGAST_7_12D>, <Completion: AGAST_FEATURE_DETECTOR_AGAST_7_12S>, <Completion: AGAST_FEATURE_DETECTOR_NONMAX_SUPPRESSION>, <Completion: AGAST_FEATURE_DETECTOR_OAST_9_16>, <Completion: AGAST_FEATURE_DETECTOR_THRESHOLD>, <Completion: AgastFeatureDetector>, <Completion: AgastFeatureDetector_AGAST_5_8>, <Completion: AgastFeatureDetector_AGAST_7_12d>, <Completion: AgastFeatureDetector_AGAST_7_12s>, <Completion: AgastFeatureDetector_create>, <Completion: AgastFeatureDetector_NONMAX_SUPPRESSION>, <Completion: AgastFeatureDetector_OAST_9_16>, ...
- Have tried to update
numpy
package to the newest one (1.19) and also tried to use an older version (1.10). No success.
If anyone could give me a hint, I'll be glad, even to point where the issue really is (VS Code, python extension, jedi package).
And one last information: numpy autocomplete works normally.