Skip to content

Instantly share code, notes, and snippets.

@JasonCrowe
Last active July 13, 2020 11:15
Show Gist options
  • Save JasonCrowe/8d237a6d302bc8ec9764a0edfb60bd70 to your computer and use it in GitHub Desktop.
Save JasonCrowe/8d237a6d302bc8ec9764a0edfb60bd70 to your computer and use it in GitHub Desktop.
from subprocess import call
from pkgutil import iter_modules
def install_package(name):
if name not in [tuple_[1] for tuple_ in iter_modules()]:
print(f"Installing {name} Library for Python")
call(["pip", "install", name])
packages = ['selenium', 'requests', 'pandas', 'xlrd', 'xlwt', 'openpyxl', 'parsel']
[install_package(x) for x in packages]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment