From 0c43fbea0296cf699887bbc628d29bc3093772c1 Mon Sep 17 00:00:00 2001 From: Chuck SmileyRekiere Date: Wed, 5 May 2021 08:50:53 -0600 Subject: [PATCH] update_dependencies.py : keep track of packages that were successful and those not Signed-off-by: Chuck SmileyRekiere --- py-scripts/update_dependencies.py | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/py-scripts/update_dependencies.py b/py-scripts/update_dependencies.py index 150605b2..7ec89a72 100755 --- a/py-scripts/update_dependencies.py +++ b/py-scripts/update_dependencies.py @@ -1,10 +1,26 @@ #!/usr/bin/env python3 import subprocess def main(): - command = "pip3 install pandas plotly numpy paramiko bokeh websocket-client pyarrow xlsxwriter pyshark influxdb influxdb-client matplotlib pdfkit pip-search --upgrade" - res = subprocess.call(command, shell = True) + print("Installing Script Python3 Dependencies") + packages = ['pandas', 'plotly', 'numpy', 'paramiko', 'bokeh', 'websocket-client', 'pyarrow', 'xlsxwriter',\ + 'pyshark', 'influxdb', 'influxdb-client', 'matplotlib', 'pdfkit', 'pip-search' ] + packages_installed = [] + packages_failed =[] + for package in packages: + command = "pip3 install {} ".format(package)#pandas plotly numpy paramiko bokeh websocket-client pyarrow xlsxwriter pyshark influxdb influxdb-client matplotlib pdfkit pip-search --upgrade" + res = subprocess.call(command, shell = True) + if res == 0: + print("Package {} install SUCCESS Returned Value: {} ".format(package, res)) + packages_installed.append(package) + else: + print("Package {} install FAILED Returned Value: {} ".format(package, res)) + print("To see errors try: pip3 install {}".format(package)) + packages_failed.append(package) - print("Returned Value: ", res) + + print("Install Complete") + print("Packages Installed Success: {}".format(packages_installed)) + print("Packages Failed (Some scripts may not need): {}".format(packages_failed)) if __name__ == "__main__": main()