幸好我以前安装什么库都记录了下来。就写了一个能批量安装Python库的Python代码。(有兴趣的可以自己编译成exe,以后留用。)
功能:
1,他首先会检查你是否安装pip,如果没有安装会自动安装。
2,他会检查你pip的版本,如果不是最新版会自动更新。
3,批量安装指定的Python包,优先使用国内镜像源,如果失败会自动重试。
[color=]如果你感兴趣,免费的评分给一个吧。
[Python] 纯文本查看 复制代码import subprocess
import time
import sys
import io
# 设置标准输出和错误输出的编码为UTF-8
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8')
sys.stderr = io.TextIOWrapper(sys.stderr.buffer, encoding='utf-8')
# 需要安装的包列表
PACKAGES = [
"Flask",
"pyperclip",
"pycryptodome",
"wmi",
"pillow",
"ntplib",
"pyDes",
"requests",
"pystray",
"baidu-aip",
"pandas",
"docxtpl",
"openpyxl",
"lxml",
"retrying",
"bs4",
"mysql-connector-python",
"xlwt",
"faker",
"pysimplegui",
"PyQt5",
"qrcode[pil]",
"opencv-python",
"PyPDF2 Pillow",
"humanize",
"edge-tts",
"tqdm",
"PyPDF2",
"ttkbootstrap",
"pyecharts",
"screeninfo",
"mss",
"fitz",
"PySide6",
"print",
"waitress",
"PyQt6",
]
def install_package(package, max_retries=3, retry_delay=10):
"""
安装指定的Python包,优先使用国内镜像源,如果失败会自动重试
:param package: 要安装的包名
:param max_retries: 最大重试次数
:param retry_delay: 重试间隔(秒)
"""
retry_count = 0
# 国内镜像源列表
MIRRORS = [
"https://pypi.tuna.tsinghua.edu.cn/simple",
"https://mirrors.aliyun.com/pypi/simple/",
"https://pypi.mirrors.ustc.edu.cn/simple/"
]
while retry_count
《Excel文件比较器v1.3》
https://www.52pojie.cn/thread-2020893-1-1.html
《个性计算器》
https://www.52pojie.cn/thread-2028540-1-1.html
没啥用软件 - 《本地测试服务器》
https://www.52pojie.cn/thread-2030222-1-1.html