Code completion with sgtk module

When using import sgtk, I can’t access code completion, navigation, or other useful developer features because sgtk is a runtime alias for the tank module. I could use import tank as sgtk, but it doesn’t feel right using the legacy tank name.

Is there a way to get code completion to work for sgtk in PyCharm or any other IDEs?

Also are there any plans to officially refactor the tank module to sgtk and maybe keep tank as the alias?

Thanks!

2 Likes

Just wanted to say I noticed the new ariel-swap-sgtk-tank branch yesterday :eyes: which was very exciting. I checked-out that branch in my local copy of tk-core and the code completion and navigation with sgtk all work great now! I’m not actually using that branch in the pipeline configuration since it’s not main-line but works perfect for this purpose in PyCharm.

Thanks Ariel!

2 Likes

Hi! I’m also looking for a solution to this.

THIS is the only info I found, but it’s not helping unfortunately…

I’m using Pycharm too, and I’m not getting the code completion either trying to type the line import tank as sgtk command

Any help would be appreciated.

Thanks!

Hi, maybe it will still help someone who use Pycharm…

I have install sgtk puthon lib like here:
https://developers.shotgridsoftware.com/tk-core/initializing.html#installing-the-sgtk-module-using-pip

Than I add “Python Package Folder” in main project folder and put there only init.py file with one liner:

from tank import *

And it’s works for me.

1 Like