From 46d20e69bcbce2d8bb1a54465b2b5a8bfb88a4da Mon Sep 17 00:00:00 2001 From: ClaytonWWilson Date: Tue, 17 Jul 2018 08:52:52 -0400 Subject: [PATCH] Finished "Install Requirements" option. --- actions.py | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/actions.py b/actions.py index 8a9dbef..60d9909 100644 --- a/actions.py +++ b/actions.py @@ -188,11 +188,17 @@ def download(imageType, parsed_respObj): return saveNameList def installReqs(): - if is_pip_installed == True: - # open Requirements.txt - # subprocess.call(["pip", "install", module], stdout=subprocess.DEVNULL, - # stdin =subprocess.DEVNULL, - # stderr=subprocess.DEVNULL) + if is_pip_installed() == True: + with open("requirements.txt") as f: + reqs = f.readlines() + reqs = [x.strip() for x in reqs] + + for module in reqs: + print("Installing {}... ".format(module)) + subprocess.call(["pip", "install", module], stdout=subprocess.DEVNULL, + stdin =subprocess.DEVNULL, + stderr=subprocess.DEVNULL) + print("Done!\n") else: print("You need to install pip.")