一.os的基本使用
os.system()
使用os的system命令进行安装第三方模块
#导入模块 import os #解析文件 cmds = {"numpy","matplotlib","pillow","requests","jieba", "beautifulsoup4","wheel","networkx","sympy", "pyinstaller","django","flask","pyqt5","pandas", "pypdf2","pygame"} try: for cmd in cmds: os.system("pip install "+cmd) print(cmd+"成功!") except: print(cmd+"失败!")