Python实例14:第三方库安装脚本
问题分析:需求:批量安装第三方库需要人员干预,能否自动安装?自动执行pip逐一根据安装需求安装;如何自动执行一个程序?
库名 | 描述 |
---|---|
NumPy: | N维数据表示和运算; |
Matplotlib: | 二维数据可视化; |
PIL: | 图像处理; |
Scikit-Learn: | 机器学习和数据挖掘; |
Requests: | HTTP协议访问及网络爬虫; |
Jieba: | 中文分词; |
Beautiful Soup: | HTML和XML解析器; |
Wheel: | Python第三方库文件打包工具; |
PyInstaller: | 打包Python源文件为可执行文件; |
Django: | Python最流行的Web开发框架; |
Flask: | 轻量级Web开发框架; |
WeRoBot: | 微信机器人开发框架; |
SymPy: | 数学符号计算工具; |
Pandas: | 高效数据分析和计算; |
Networkx: | 复杂网络和图结构的建模和分析; |
PyQt5: | 基于Qt的专业级GUI开发框架; |
PyOpenGL: | 多平台OpenGL开发接口; |
PyPDF2: | PDF文件内容提取及处理; |
docopt: | Python命令行解析; |
PyGame: | 简单小游戏开发框架; |
#BatchInstall.py
import os
libs = {"NumPy","Matplotlib","PIL","Scikit-Learn","Requests","Jieba","Beautiful Soup",\
"Wheel","PyInstaller","Django","Flask","WeRoBot","SymPy","Pandas","Networkx",\
"PyQt5","PyOpenGL","PyPDF2","docopt","PyGame"}
try:
for lib in libs:
os.system("pip install " + lib)
print("Successful")
except:
print("Failed Somehow")
点赞,关注,收藏👍,➕,👀点赞,关注,收藏👍,➕,👀点赞,关注,收藏👍,➕,👀
😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘😘
💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪💪