Setting Environment Variables on Linux


#1

Trying to set MAYA_MODULE_PATH using shell environment variables but Maya does not see it.

export MAYA_MODULE_PATH=/pathToModulesDir 

If I set it using Maya.env file everything is ok. In Maya docs they said:

Use setenv to set environment variables in your .cshrc file. For example:

setenv MAYA_SCRIPT_PATH /server/myscripts

How can I do this?

OS = CentOS 7


#2

Are you setting it inside the process that launches maya? If you just open random console and run “export”, then launch maya with the desktop shortcut, this is not supposed to work.


#3

Yes, I was doing it as you said. I have also added setenv MAYA_MODULE_PATH=/moduleDir to .cshcr file but without success. How to set env variables without Maya.env file?


#4

See if you can change shortcut command to something like this:

YOUR_VARIABLE=your_value /path/to/maya/bin/maya 

…or you can create a simple shell file like

export YOUR_VARIABLE=your_value;
 /path/to/maya/bin/maya 

…and set your shortcut to launch this file.

Or just google for generic “global environment variable Centos” and there’s a lot of resources suggesting different locations like .profile or .bashrc file.


#5

Shell file worked. Thanks!