mirror of
https://github.com/langbot-app/LangBot.git
synced 2026-07-18 10:26:07 +00:00
feat: 启动时自动安装Pillow库
This commit is contained in:
@@ -43,9 +43,9 @@ def init_db():
|
|||||||
database.initialize_database()
|
database.initialize_database()
|
||||||
|
|
||||||
|
|
||||||
def ensure_openai():
|
def ensure_dependencies():
|
||||||
import pkg.utils.pkgmgr as pkgmgr
|
import pkg.utils.pkgmgr as pkgmgr
|
||||||
pkgmgr.run_pip(["install", "openai", "--upgrade"])
|
pkgmgr.run_pip(["install", "openai", "Pillow", "--upgrade"])
|
||||||
|
|
||||||
|
|
||||||
known_exception_caught = False
|
known_exception_caught = False
|
||||||
@@ -348,7 +348,7 @@ if __name__ == '__main__':
|
|||||||
else:
|
else:
|
||||||
print("这个操作不是必须的,如果不想更新,请在config.py中将upgrade_dependencies设置为False")
|
print("这个操作不是必须的,如果不想更新,请在config.py中将upgrade_dependencies设置为False")
|
||||||
try:
|
try:
|
||||||
ensure_openai()
|
ensure_dependencies()
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
print("更新openai库失败:{}, 请忽略或自行更新".format(e))
|
print("更新openai库失败:{}, 请忽略或自行更新".format(e))
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user