fixed automatically determine and set the PYRO_ENV variable

fixed automatically determine and set the PYRO_ENV variable