1

I am a Mac M1 Pro user, and the past couple of days have been working with the openCV library. Initially, I had the issue with the library installation and stuff but using a combination of mini-forge, Conda, virtual Environements,and version control I managed to get it working.

However, the intellisense that is used in vscode to autocomplete code (give suggestions) does not seem to recognise openCV and gives no suggestions.

I have tried all the potential solutions out there such as:

  • updating VScode
  • Quitting and restarting VScode
  • Adding python.autocomplete.extrapath to settings
  • using intellicode
  • Deleting the virtual environment and do the same in another venv!

But still nothing seems to work. Therefore, I would highly appreciate any assistance/advice/help to solve this.

The Python version on the venv: 3.8.6 The OpenCV version on the venv: 4.5.3 The VScode version on Mac: June 2022 update

enter image description here

Thanks again for any help! Happy Coding!

Christoph Rackwitz
  • 11,317
  • 4
  • 27
  • 36
milad
  • 19
  • 1
  • This seems to be a problem that has appeared before. Are the methods mentioned in this [issue](https://stackoverflow.com/questions/60428259/vscode-autocomplete-not-working-for-opencv-installed-from-source) effective? If it doesn't work, please follow the content in this [case](https://github.com/microsoft/vscode-python/issues/14661) and resubmit a new question. – MingJie-MSFT Jul 18 '22 at 01:25

1 Answers1

-1

Sorry looks like an old question. I just had a slightly different issue but same autocomplete thingy, was pulling my hair out for a few hours. I created a conda env e.g conda env create -f build.yml -n <env_name> then the Error I had was ModuleNotFoundError: No module named 'cv2'

I selected the the python interpreter for my environment - cmd + shift + p Python Select Interpreter and solved my issues, hope this helps

roshambo
  • 2,624
  • 6
  • 31
  • 54