def parse_requirements(filename):
    """
    Load requirements from a pip requirements file.

    :param filename: file name with requirements to parse
    """

    try:
        with open(filename) as fh_req:
            return [line.strip() for line in fh_req if line.strip() and not line.startswith('#')]
    except FileNotFoundError:
        print('File not found: {}'.format(realpath(filename)), file=stderr)
        raise
Load requirements from a pip requirements file.

    :param filename: file name with requirements to parse