fix: 修复相对路径导致的windows启动器无法安装依赖的问题
This commit is contained in:
@@ -8,10 +8,8 @@ from logging import Formatter, Logger
|
|||||||
from util.cmd_config import CmdConfig, try_migrate_config
|
from util.cmd_config import CmdConfig, try_migrate_config
|
||||||
|
|
||||||
warnings.filterwarnings("ignore")
|
warnings.filterwarnings("ignore")
|
||||||
abs_path = os.path.dirname(os.path.realpath(sys.argv[0])) + '/'
|
|
||||||
|
|
||||||
logger: Logger = None
|
logger: Logger = None
|
||||||
|
|
||||||
logo_tmpl = """
|
logo_tmpl = """
|
||||||
___ _______.___________..______ .______ ______ .___________.
|
___ _______.___________..______ .______ ______ .___________.
|
||||||
/ \ / | || _ \ | _ \ / __ \ | |
|
/ \ / | || _ \ | _ \ / __ \ | |
|
||||||
@@ -35,9 +33,11 @@ def update_dept():
|
|||||||
'''
|
'''
|
||||||
# 获取 Python 可执行文件路径
|
# 获取 Python 可执行文件路径
|
||||||
py = sys.executable
|
py = sys.executable
|
||||||
|
requirements_path = os.path.join(os.path.dirname(os.path.abspath(__file__)), "requirements.txt")
|
||||||
|
print(requirements_path)
|
||||||
# 更新依赖库
|
# 更新依赖库
|
||||||
mirror = "https://mirrors.aliyun.com/pypi/simple/"
|
mirror = "https://mirrors.aliyun.com/pypi/simple/"
|
||||||
os.system(f"{py} -m pip install -r requirements.txt -i {mirror}")
|
os.system(f"{py} -m pip install -r {requirements_path} -i {mirror}")
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in New Issue
Block a user