Missing urllib2 import.
Use zipfile, not tarfile.