2

Hey guys I am using PyCharm to code in python.

Python Version: 3.6.1 CV2 Version: 3.2.0

When I import cv2 with "import cv2" the autocomplete in PyCharm is broken. There are no suggestions with cv2. --> When I'm writing cv2.cv2. --> then I get the right suggestions but the code does not work.

bad_coder
  • 8,684
  • 19
  • 37
  • 59
Marker
  • 21
  • 3
  • Possible duplicate of [Autocomplete for OpenCV-Python in Windows not working](http://stackoverflow.com/questions/18672087/autocomplete-for-opencv-python-in-windows-not-working) – thewaywewere May 03 '17 at 17:41
  • Possible duplicate of [PyCharm Opencv - autocomplete with import cv2.cv2, no errors with import cv2](https://stackoverflow.com/questions/44659906/pycharm-opencv-autocomplete-with-import-cv2-cv2-no-errors-with-import-cv2) – Georgy Aug 28 '19 at 06:12

1 Answers1

0

Try the following:

import cv2.cv2 as cv2

That solved the problem for me

Community
  • 1
  • 1
Xaaris
  • 51
  • 5
  • This should be a comment, not an answer. – trincot Dec 16 '18 at 20:12
  • This did not work for me. I've answered how I solved here: https://stackoverflow.com/questions/61190224/opencv-built-from-source-pycharm-doesnt-get-autocomplete-information/61281004#61281004 – Marco Apr 21 '20 at 21:38