python-第三方库安装脚本

#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("pip3 install "+lib)
    print("Successful")        
except:
    print("Failed Somehow")

os库是提供通用的基本的操作系统交互功能
常用os.path子库对文件路径操作
os.system子库:进程管理
还有环境参数子库如os.chdir()等

你可能感兴趣的:(python)