批量安装python第三方包

import os
libs =  {'numpy','selenium','tabula-py','pandas','pygame','matplotlib','psutil','re','logging','request','locus','django','openpyxl'}



try:
	for lib in libs:
		y = 'pip install -i  https://pypi.tuna.tsinghua.edu.cn/simple/' + ' '+ lib
		os.system(y)
		print('%s 安装成功' % lib)

except:
	print('%s 安装失败' % lib )

你可能感兴趣的:(python)