From b6d731cf870655940e65993e30d09c7a5330c740 Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Tue, 21 Feb 2023 17:16:18 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20=E4=BF=AE=E6=94=B9=E4=BD=BF=E7=94=A8?= =?UTF-8?q?=E7=9A=84=E4=BE=9D=E8=B5=96=E7=89=88=E6=9C=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.py | 10 ++++++++-- requirements.txt | 2 +- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/main.py b/main.py index b0da21f..6b22c55 100644 --- a/main.py +++ b/main.py @@ -10,8 +10,14 @@ import sys try: import colorlog except ImportError: - print("未安装colorlog,请查看 https://github.com/RockChinQ/qcg-installer/issues/15") - sys.exit(1) + # 尝试安装 + import pkg.utils.pkgmgr as pkgmgr + pkgmgr.install_requirements("requirements.txt") + try: + import colorlog + except ImportError: + print("依赖不满足,请查看 https://github.com/RockChinQ/qcg-installer/issues/15") + sys.exit(1) import colorlog import requests diff --git a/requirements.txt b/requirements.txt index 43738b7..da4aba4 100644 --- a/requirements.txt +++ b/requirements.txt @@ -3,7 +3,7 @@ openai~=0.25.0 pip~=22.3.1 dulwich~=0.20.50 colorlog~=6.6.0 -yiri-mirai~=0.2.7 +yiri-mirai~=0.2.6.1 websockets~=10.4 urllib3~=1.26.10 func_timeout~=4.3.5 \ No newline at end of file