python hints/autocompletion in IDE

Hi everyone, i managed to build itk with python wrappers on a win10 machine using visual studio 2017. However I am not getting the full hints after importing itk in a visual studio code IDE.

I built master at ENH: Generate stub-files to support type hints · InsightSoftwareConsortium/ITK@faa3ab0 · GitHub commit

I can run any code I previously wrote, but for some reason I can’t get autocompletion suggestion other than the quick wraps like imread, imwrite, etc.
For instance I can’t get itk.FlatStructuringElement to be suggested, ora any filter type for that matter.

Am I getting this wrong? Should I move to a more recent commit? I’ve tried building from scratch since the issue was relevant in the pip distribution.

@kjweimer and @hjmjohnson might be able to help.

What IDE are you using? I know that only PyCharm is advertised as currently supported. If I remember correctly, we would like to expand that.

1 Like

Ok, I was worried it may be an IDE issue. Right now I am using VS Code with a python add-on for pylance and other tools. I’ll try my hands on PyCharm and update you.
Thanks for the reply!

Ok PyCharm is better but it still doesn’t handle all available suggestions, this is possibly due to the fact that I’m not using conda or other virtual environments as well?

We are using pycharm, but any IDE or tool that supports .pyi files should benefit.

Hans

1 Like