import importlib


def try_import(name, package=None):
    """Try import package name in package."""
    try:
        return importlib.import_module(name, package=package)
    except ImportError:
        return None