automation - automated script to install python package over a proxy? -
would possible write little python script automatically install needed python library import if needed library wasn't installed?
currently using
try: import xlrd #library iterate through excel docs except importerror: raise importerror('xlrd not installed, use "sudo pip install xlrd"\n')
but more automated.
as mentioned in comments setup.py approach 1 , quite easy.
beyond if need install dependencies across multiple servers suggest have @ solution http://www.ansible.com/home or https://puppetlabs.com/
as one-off can too:
ssh user@yourserver.com 'pip install xlrd'
edit - following on comments:
once have created setup.py specifying dependency on xlrd have run on every machine want install app. in order checkout automation tool advised above.
you that's dirty:
try: import xlrd #library iterate through excel docs except importerror: subprocess import call call(["pip", "install", "xlrd"])
Comments
Post a Comment