Be sure the 'sys' module is loaded