-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun.py
More file actions
68 lines (59 loc) · 2.07 KB
/
Copy pathrun.py
File metadata and controls
68 lines (59 loc) · 2.07 KB
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Neo Agent - 简化启动脚本 / Simplified Launcher
用于直接运行GUI应用,无需安装包
This launcher works without package installation by running the GUI module directly.
"""
import sys
import os
# Get the directory where this script is located
script_dir = os.path.dirname(os.path.abspath(__file__))
# Add the script directory to Python path
if script_dir not in sys.path:
sys.path.insert(0, script_dir)
# Change to script directory to ensure relative paths work
os.chdir(script_dir)
# Now run the main GUI module directly
if __name__ == "__main__":
try:
# Import and run the GUI
from src.gui import gui_enhanced
import tkinter as tk
from tkinter import ttk
root = tk.Tk()
style = ttk.Style()
try:
style.theme_use('clam')
except:
pass
app = gui_enhanced.EnhancedChatDebugGUI(root)
root.mainloop()
except ImportError as e:
print("=" * 60)
print("导入错误 / Import Error")
print("=" * 60)
print(f"无法导入所需模块: {e}")
print(f"Cannot import required modules: {e}")
print()
print("请检查以下事项 / Please check:")
print("1. 是否在项目根目录运行? / Running from project root?")
print(f" 当前目录 / Current dir: {os.getcwd()}")
print("2. 是否安装了所有依赖? / All dependencies installed?")
print(" 运行 / Run: pip install -r requirements.txt")
print("3. Python版本是否>=3.8? / Python version >= 3.8?")
print(f" 当前版本 / Current: {sys.version}")
print()
import traceback
traceback.print_exc()
sys.exit(1)
except Exception as e:
print("=" * 60)
print("运行错误 / Runtime Error")
print("=" * 60)
print(f"应用启动失败: {e}")
print(f"Application failed to start: {e}")
print()
import traceback
traceback.print_exc()
sys.exit(1)