Relatively simple question, how does one pip install several packages/modules within a python script? I have a script that calls on other scripts, and several people use the main script. So when someone runs it, it needs to install or update all listed packages automatically.
I tried using the solution linked but was unable to get something working.
Below code,
# Implement pip as a subprocess:
package = ['os', 'time', 'glob2', 'selenium', 'chromedriver_binary',
'time', 'datetime']
def install(package):
subprocess.check_call([sys.executable, '-m', 'pip', 'install', package])