os.environ(x [,x]) raises an exception if the environmental variable does not exist. os.getenv(x) does not raise an exception ,but returns None.