def get_req_by(package, index_file=PIP_INDEX_FILE):
    """
    get the packages that require this package
    :param package: package name
    :type package: str
    :return: a list of packages that require this package
    :rtype: list
    """
    if os.path.exists(index_file):

        with open(index_file) as f:
            index=json.load(f)
            required_by=[]
            for pkg, req in index.items():
                if package in req:
                    required_by.append(pkg)
    else:

        raise PipError("Cannot find index file. Try to using 'pip dev update-index' to update index file")

    return required_by

    get the packages that require this package
    :param package: package name
    :type package: str
    :return: a list of packages that require this package
    :rtype: list
    
bin/pip.py