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

Setting TMPDIR in Maya.env is not working

Message 1 of 5
1279 Views, 4 Replies

Setting TMPDIR in Maya.env is not working



I've edited the Maya.env file in ~/Library/Preferences/Autodesk/maya/2020 and added:


TMPDIR = '/Volumes/NVMe Array/Caches'


After restarting Maya and using the getenv 'TMPDIR' command, the variable has not been changed.


I also tried setting the variable in Maya using putenv 'TMPDIR' '/Volumes/NVMe Array/Caches'. Then, getenv DOES return the new path until I restart Maya, then the path has reverted to the default again.


Does anyone know why this is happening?


I'm using Maya 2020 on macOS 10.15.6

Labels (2)
Message 2 of 5

Also, I have confirmed that the Maya.env file is being picked up by Maya.


I added a random variable TEST=testing to Maya.env and after loading Maya, getenv TEST does return testing. So, the issue seems to be only with the TMPDIR environment variable.

Message 3 of 5

I just found this in Setting environment variables using system commands:


"The variables set in the operating system take priority over any settings in the Maya.env file."


So, apparently, since TMPDIR is already set on macOS somewhere in /var/folders/ I can't override it.


How, then, do I make Maya store its temporary files in another location without changing TMPDIR at the system level?

Message 4 of 5

The solution to this is to run Maya from the command line.


A convenient approach is to create an alias in your .bash_profile (or similar) that sets the TMPDIR variable and runs the Maya executable:



alias maya="TMPDIR=path/to/temp /Applications/Autodesk/maya2020/"



The first part of the alias, "TMPDIR=path/to/temp", sets the path to the new temporary folder.


The second part is the command "/Applications/Autodesk/maya2020/" that opens Maya. Note that it is the path to the maya binary for version 2020. Adjust the version number as needed.


This approach leaves the default TMPDIR value unchanged for other applications and sets a new value in a separate process just for the instance of Maya that it's running.

Message 5 of 5

Hi @rogueninjacreative 


Glad to hear you figured it out and thanks so much for sharing the solution! This will benefit other users in the community with the same issue.

Lynn Zhang
Community Manager

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

Post to forums  

Technology Administrators

Autodesk Design & Make Report