def check_dependency(self):
list_deps = []
missing_deps = []
with open('requirements.txt') as f:
list_deps = f.read().splitlines()
pip_list = sorted([(i.key) for i in pip.get_installed_distributions()])
for req_dep in list_deps:
if req_dep not in pip_list:
# Why this package is not in get_installed_distributions ?
if str(req_dep) == "argparse":
pass
else:
missing_deps.append(req_dep)
if missing_deps:
missing_deps_warning ="""
You are missing a module required for Belati. In order to continue using Belati, please install them with:
{}`pip install --upgrade --force-reinstall -r requirements.txt`{}
or manually install missing modules with:
{}`pip install --upgrade --force-reinstall {}`{}
"""
log.console_log(missing_deps_warning.format(Y, W, Y, ' '.join(missing_deps), W))
sys.exit()
评论列表
文章目录