Actually... I can do a try: import base64 except ImportError: import upip upip.install("...base64")