From 376b2fef400a2cf7c12bd04045956020bbcca649 Mon Sep 17 00:00:00 2001 From: Soulter <37870767+Soulter@users.noreply.github.com> Date: Sun, 23 Apr 2023 09:05:30 +0000 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=90=AF=E5=8A=A8?= =?UTF-8?q?=E5=89=8D=E6=A3=80=E6=9F=A5=E4=BE=9D=E8=B5=96=E7=9A=84=E9=97=AE?= =?UTF-8?q?=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index cbbd6763..47bac864 100644 --- a/main.py +++ b/main.py @@ -45,20 +45,24 @@ def check_env(): input("按任意键退出...") exit() + if os.path.exists('requirements.txt'): + pth = 'requirements.txt' + else: + pth = 'QQChannelChatGPT'+ os.sep +'requirements.txt' print("正在更新三方依赖库...") - mm = os.system('pip install -r QQChannelChatGPT/requirements.txt') + mm = os.system('pip install -r '+pth) if mm == 0: print("依赖库安装完毕。") else: while True: res = input("依赖库可能安装失败了。\n如果是报错ValueError: check_hostname requires server_hostname,请尝试先关闭代理后重试。\n输入y回车重试\n输入c回车使用国内镜像源下载\n输入其他按键回车继续往下执行。") if res == "y": - mm = os.system('pip install -r QQChannelChatGPT/requirements.txt') + mm = os.system('pip install -r '+pth) if mm == 0: print("依赖库安装完毕。") break elif res == "c": - mm = os.system('pip install -r QQChannelChatGPT/requirements.txt -i https://mirrors.aliyun.com/pypi/simple/') + mm = os.system(f'pip install -r {pth} -i https://mirrors.aliyun.com/pypi/simple/') if mm == 0: print("依赖库安装完毕。") break