try: from Crypto.Cipher import AES except ImportError: print "You don't have PyCrypto installed" print "We will try installing this for you" if os.path.exists("pip"): system("pip install colorama") else: # Time to install pip getPip() system("pip install pycrypto") try: from Crypto.Cipher import AES except ImportError: print "Looks like you don't have pip in your path" print "Try installing it on your own"