Hello – you’ll want to add the path to Toolkit Core API to your
sys.path in Python; then you should be able to import
sgtk. If you have a centralized Toolkit pipeline configuration, by default it should have its own copy of the Core API in the
install/core/ directory, and within that, we want to get to the
python/ directory. So, in my case, my pipeline config is in
/sgtk/software/shotgun/goats, so the following works:
This will allow your code to run, but depending on what you’re doing in your script with the Toolkit API, it may require Toolkit’s
tk-maya engine to be running and/or for you to have a Toolkit context.
To have this path added to your
sys.path every time Maya is launched, you can add it to the
PYTHONPATH environment variable via the Maya.env file, or add the above lines of Python to Maya’s
user_setup.py file. You can see the sections on Initializing the Maya Environment in and for Python and Adding Items to your Python Path in the Python in Maya page from Maya’s documentation.
Let us know if you hit any snags with that!