第三方库自动安装脚本
2019-02-15 本文已影响1人
小星star
需求:批量安装第三方库需要人工干预,能否自动安装?
自动执行pip逐一根据安装需求安装
#BatchInstall.py
import os
libs = {"numpy","matplotlib","pillow","sklearn","requests",\
"jieba","beautifulsoup4","wheel","networkx","sympy",\
"pyinstaller","django","flask","werobot","pyqt5",\
"pandas","pyopengl","pypdf2","docopt","pygame"}
try:
for lib in libs:
os.system("pip install " + lib)
print("Successful")
except:
print("Failed Somehow")
运行:打开cmd,在cmd中输入python BatchInstall.py来运行程序
编写各类自动化运行程序的脚本,调用已有程序