Community
Maya Forum
Welcome to Autodesk’s Maya Forums. Share your knowledge, ask questions, and explore popular Maya topics.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

How to get Maya installed location in python

2 REPLIES 2
Reply
Message 1 of 3
ljc091111
688 Views, 2 Replies

How to get Maya installed location in python

In windows, I use  "os.environ", but there is no maya location. Dose anyone konws?
2 REPLIES 2
Message 2 of 3
brentmc
in reply to: ljc091111

Hi,

 

Are you saying this doesn't work?

mayaLocation = os.environ['MAYA_LOCATION']

 

Brent McPherson
Principle Engineer
Message 3 of 3
Stephen.Blair
in reply to: ljc091111

Where are you running this Python? In Maya? Because MAYA_LOCATION is set by Maya when Maya starts up.
If you try to get MAYA_LOCATION from outside the Maya process, you won't get anything.

In that case, check HKEY_LOCAL_MACHINE\SOFTWARE\Autodesk\Maya\2022\Setup\InstallPath



// Stephen Blair
// Arnold Renderer Support

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums