try: from matplotlib.pyplot import imshow, imsave except ImportError: print "Could not import Matplotlib."