Autocomplete in PyCharm for Python compiled extensions

The imports are marked with a grey underline, saying “unresolved reference” as a tooltip

This most probably means that PyCharm can’t see the module you import. In editing mode, PyCharm relies on availability of Python sources of imported modules. If a module is not written in Python but is a C extension module, PyCharm generates a ‘skeleton’ that contains function prototypes, and uses it for completion.

In shell mode, PyCharm uses live imported objects for completion, with slightly different results.

Make sure that your OpenCV installation is visible for the Python interpreter you chose for the project (File / Settings / Python interpreter). If the interpreter is correct, try removing and re-adding it (this is time-consuming a bit, sorry).

If nothing helps, file a bug.

Leave a Comment