Skip to content

Commit 55f9dbf

Browse files
committed
[更新] 更新检查依赖库是否安装, 没有安装自动安装.
1 parent d6fbfad commit 55f9dbf

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

buildpkg.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@
3636
import time
3737
import shutil
3838
import platform
39+
import imp
3940

4041
# --------------------------------------------------------------------------------
4142
# Info and config
@@ -168,6 +169,21 @@ def _check_self():
168169
_run_log.info("Please do not delete the license, otherwise you will not be able to use buildpkg!")
169170
exit(1)
170171

172+
# 5. check if the library generated by the license is installed
173+
try:
174+
imp.find_module('lice')
175+
found = True
176+
except ImportError:
177+
if sys.version_info < (3, 0):
178+
os.system("easy_install lice")
179+
_run_log.info("The license generation module was not found, Automatic installation by easy_install!")
180+
else:
181+
os.system("pip install lice")
182+
_run_log.info("The license generation module was not found, Automatic installation! by pip")
183+
184+
# 6. 检查模板文件是否存在
185+
# 7. 检查包路径是否存在
186+
171187
# --------------------------------------------------------------------------------
172188
# Analyze the path to use
173189
# --------------------------------------------------------------------------------

0 commit comments

Comments
 (0)