Hi Etienne,
'%TEMP%' is the current standard. On the other hand '%TMP%' dates back to time when only DOS existed.
I would suggest you to try following steps:
1. Please make sure that MATLAB engine is shared. To do this execute following command at MATLAB command line:
>> matlab.engine.shareEngine
2. Try running following script:
import os
import matlab.engine
#change made here
os.environ["TMP"]= os.environ["TEMP"];
#same path as given by getenv('TEMP')
os.environ["TEMP"]='C:\\...'
#To make sure that MATLAB engine is connected.
#Following should display '2.0'
eng = matlab.engine.connect_matlab()
print eng.sqrt(4.0)
print "\n"
print matlab.engine.find_matlab()
Hope this helps.
Please feel free to reach out if this issue still persists.