def print_package_version(package_name, indent='  '):
    try:
        package = __import__(package_name)
        version = getattr(package, '__version__', None)
        package_file = getattr(package, '__file__', )
        provenance_info = '{0} from {1}'.format(version, package_file)
    except __HOLE__:
        provenance_info = 'not installed'

    print('{0}{1}: {2}'.format(indent, package_name, provenance_info))
dataset/ETHPy150Open neurosynth/neurosynth/ci/show-python-package-versions.py/print_package_version