2023-01-16 21:34:35 +08:00
|
|
|
from pip._internal import main as pipmain
|
|
|
|
|
|
2024-01-29 21:22:27 +08:00
|
|
|
# from . import log
|
2023-02-08 17:07:20 +08:00
|
|
|
|
2023-01-16 21:34:35 +08:00
|
|
|
|
|
|
|
|
def install(package):
|
|
|
|
|
pipmain(['install', package])
|
2024-01-29 21:22:27 +08:00
|
|
|
# log.reset_logging()
|
2023-04-14 18:42:09 +08:00
|
|
|
|
|
|
|
|
def install_upgrade(package):
|
2023-09-13 07:54:53 +00:00
|
|
|
pipmain(['install', '--upgrade', package, "-i", "https://pypi.tuna.tsinghua.edu.cn/simple",
|
|
|
|
|
"--trusted-host", "pypi.tuna.tsinghua.edu.cn"])
|
2024-01-29 21:22:27 +08:00
|
|
|
# log.reset_logging()
|
2023-01-16 21:34:35 +08:00
|
|
|
|
|
|
|
|
|
2023-03-04 10:16:47 +08:00
|
|
|
def run_pip(params: list):
|
|
|
|
|
pipmain(params)
|
2024-01-29 21:22:27 +08:00
|
|
|
# log.reset_logging()
|
2023-03-04 10:16:47 +08:00
|
|
|
|
|
|
|
|
|
2023-01-16 21:34:35 +08:00
|
|
|
def install_requirements(file):
|
2023-11-12 23:16:09 +08:00
|
|
|
pipmain(['install', '-r', file, "-i", "https://pypi.tuna.tsinghua.edu.cn/simple",
|
2023-09-13 07:54:53 +00:00
|
|
|
"--trusted-host", "pypi.tuna.tsinghua.edu.cn"])
|
2024-01-29 21:22:27 +08:00
|
|
|
# log.reset_logging()
|