mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 19:57:04 +08:00
35 lines
759 B
Python
35 lines
759 B
Python
import pip
|
|
|
|
required_deps = {
|
|
"requests": "requests",
|
|
"openai": "openai",
|
|
"dulwich": "dulwich",
|
|
"colorlog": "colorlog",
|
|
"mirai": "yiri-mirai-rc",
|
|
"func_timeout": "func_timeout",
|
|
"PIL": "pillow",
|
|
"nakuru": "nakuru-project-idk",
|
|
"CallingGPT": "CallingGPT",
|
|
"tiktoken": "tiktoken",
|
|
"yaml": "pyyaml",
|
|
"aiohttp": "aiohttp",
|
|
}
|
|
|
|
|
|
async def check_deps() -> list[str]:
|
|
global required_deps
|
|
|
|
missing_deps = []
|
|
for dep in required_deps:
|
|
try:
|
|
__import__(dep)
|
|
except ImportError:
|
|
missing_deps.append(dep)
|
|
return missing_deps
|
|
|
|
async def install_deps(deps: list[str]):
|
|
global required_deps
|
|
|
|
for dep in deps:
|
|
pip.main(["install", required_deps[dep]])
|