美文网首页
第三方库自动安装脚本

第三方库自动安装脚本

作者: 小星star | 来源:发表于2019-02-15 16:46 被阅读1次

需求:批量安装第三方库需要人工干预,能否自动安装?
自动执行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来运行程序

编写各类自动化运行程序的脚本,调用已有程序

相关文章

网友评论

      本文标题:第三方库自动安装脚本

      本文链接:https://www.haomeiwen.com/subject/kldmeqtx.html