req_file = "requirements.txt"
'''
cffi==1.11.5
matplotlib==3.0.0
numpy==1.15.3
pandas==0.23.4
scikit-learn==0.20.0
# sklearn==0.0
torch==0.4.1
'''
def parse_requirements(filename):
lineiter = (line.strip() for line in open(filename))
return [line for line in lineiter if line and not line.startswith("#")]
parse_requirements(req_file)
['cffi==1.11.5',
'matplotlib==3.0.0',
'numpy==1.15.3',
'pandas==0.23.4',
'scikit-learn==0.20.0',
'torch==0.4.1']