Python pycharm and code completion

Hi!

I am running into the same issue, but @matt.mccormick’s solution does not seem to help in my case. Is it enough to add these three lines at the top of my script, or am I misunderstanding something?

The warning from PyCharm reads:

Cannot find reference ‘Image’ in ‘__init__.py’

(in the case of an itk.Image)

Some reading on the Internet seemed to imply that this is linked to the variable __all__ in __init__.py being incorrectly set by ITK’s wrappers, but my knowledge of Python is too limited to fully grasp the actual problem.

Could anyone provide additional details? It’s unnerving to see PyCharm complain so much. :laughing:

1 Like