-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
38 lines (31 loc) · 1010 Bytes
/
Copy pathmain.py
File metadata and controls
38 lines (31 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
"""
主程序入口
调用环境检查脚本并显示结果
"""
import sys
import os
# 添加env_library到Python路径
sys.path.append(os.path.join(os.path.dirname(__file__), 'env_library'))
def main():
"""主函数"""
print("=" * 60)
print("项目环境验证工具")
print("=" * 60)
print("此工具将检查所有必要的Python包是否已正确安装。")
print("对于torch,只检查是否安装,不检查具体版本。")
print("其他包必须与requirements.txt中的版本完全一致。")
print("\n按回车键开始检查...")
input()
try:
# 导入并运行检查脚本
from check_env import main as check_main
return check_main()
except ImportError as e:
print(f"错误: 无法导入检查脚本 - {e}")
print("请确保env_library/check_env.py存在")
return 1
except Exception as e:
print(f"未知错误: {e}")
return 1
if __name__ == "__main__":
sys.exit(main())