def save_to_dill(obj, name):
    """Save the Python object in a dill file."""
    try:
        import dill
    except ImportError:
        raise ImportError('# Need to install dill package to use.')
    with open(name, 'wb') as dill_file:
        dill.dump(obj, dill_file)
