UP
Browse files- check_proxy.py +6 -3
check_proxy.py
CHANGED
@@ -69,13 +69,16 @@ def patch_and_restart(path):
|
|
69 |
shutil.copyfile('config.py', 'config_private.py')
|
70 |
distutils.dir_util.copy_tree(path+'/chatgpt_academic-master', './')
|
71 |
import subprocess
|
72 |
-
print亮绿('
|
73 |
for i in reversed(range(5)): time.sleep(1); print(i)
|
74 |
-
|
|
|
|
|
|
|
75 |
print亮绿('更新完成,您可以随时在history子文件夹下找回旧版的程序,5s之后重启')
|
76 |
print亮红('假如重启失败,您可能需要手动安装新增的依赖库 `python -m pip install -r requirements.txt`,然后在用常规的`python main.py`的方式启动。')
|
77 |
-
for i in reversed(range(5)): time.sleep(1); print(i)
|
78 |
print(' ------------------------------ -----------------------------------')
|
|
|
79 |
os.execl(sys.executable, sys.executable, *sys.argv)
|
80 |
|
81 |
|
|
|
69 |
shutil.copyfile('config.py', 'config_private.py')
|
70 |
distutils.dir_util.copy_tree(path+'/chatgpt_academic-master', './')
|
71 |
import subprocess
|
72 |
+
print亮绿('代码已经更新,即将更新pip包依赖……')
|
73 |
for i in reversed(range(5)): time.sleep(1); print(i)
|
74 |
+
try:
|
75 |
+
subprocess.check_call([sys.executable, '-m', 'pip', 'install', '-r', 'requirements.txt'])
|
76 |
+
except:
|
77 |
+
print亮红('pip包依赖安装出现问题,需要手动安装新增的依赖库 `python -m pip install -r requirements.txt`,然后在用常规的`python main.py`的方式启动。')
|
78 |
print亮绿('更新完成,您可以随时在history子文件夹下找回旧版的程序,5s之后重启')
|
79 |
print亮红('假如重启失败,您可能需要手动安装新增的依赖库 `python -m pip install -r requirements.txt`,然后在用常规的`python main.py`的方式启动。')
|
|
|
80 |
print(' ------------------------------ -----------------------------------')
|
81 |
+
for i in reversed(range(8)): time.sleep(1); print(i)
|
82 |
os.execl(sys.executable, sys.executable, *sys.argv)
|
83 |
|
84 |
|