Pointing your system Variables

Hello Good day I would like to know i have installed the Shotgun Desktop app how will i got about pointing maya system Variables towards it so that may can access shotgun via that

1 Like

Hi!

I apologize, but I’m not sure I fully understand. I get that you would like to define some environment variables, and have Shotgun Desktop use them in some way, but I’m not sure I understand the “so that may can access shotgun via that” bit?

Are you saying you would like to define the site name, user name and password details in environment variables and have Shotgun automatically use them when signing in?

So yes sorry i misspelled Maya there sorry so i would like to define a System Variable on my system that allows Maya console to run the same commands as the commands i run in Shotgun console

So i would like to know where can i Point the system variables to do this so basicly where does the Shotgun console get its commands and things from

I think this is very similar to your other post

So hopefully the guide I sent you privately will give you some idea. It’s not quite as simple as providing the path to the core API that SG Desktop is using, you need to get the path to the core API for your specific project config.

I just dont completely understand where to find the sys.path

I think it’s probably fair to say that the guide expects you to have a basic understanding of Python.
Though maybe there is something I can do to make that a bit clearer.

Basically sys is a standard python library, and sys.path is a property where you can append a list of paths to locations of python modules so that python can import them.
https://docs.python.org/2/library/sys.html#sys.path

I should perhaps link out to the python documentation there.

Okay i understand basic coding but never heard of that but that’s cool lol sorry so how do i access this and look if it in the sys path or not and how would i go about linking this into maya then via the system variable

So i just inserted the sys path esentially using
sys.path.append("/shotgun/configs/my_project_config/install/core/python")
but i still cant do a
import sgtk

u got eni idea why ?

Thats why i am curious where the path is pulling from like that is before the shotgun part essentially

If the path you appended to the sys.path variable is valid and points to a folder that looks like this:
python

Then I can’t see why import sgtk would fail. What error are you getting exactly?

Yeah cool i found the file may file path wasent pointing correctly so i ran maya trhow the shotgun aplication and then ran

import sys
from pprint import pprint as p
syspathptyh = p(sys.path)

so i can see where what path is currently pointing and now i am creating software that will check and make sure its there everytime even if on other pc thank u for your asisance it is much apreciated will be in contact if i do get stuck again thank u

3 Likes