File size: 1,775 Bytes
d613ffd
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""

DEBUG STARTUP SCRIPT - Zeigt Fehler bei app.py Start

"""

import sys
import traceback
import subprocess

print("\n" + "="*70)
print("🔧 DEBUGGING APP.PY STARTUP")
print("="*70 + "\n")

# Versuch 1: Direkt importieren um Fehler zu sehen
print("1️⃣  Versuche app.py zu importieren...")
try:
    import app
    print("   ✅ app.py erfolgreich importiert!")
except Exception as e:
    print(f"   ❌ FEHLER beim Import:")
    print(f"   {type(e).__name__}: {e}")
    traceback.print_exc()
    print("\n" + "="*70)
    print("FIX VORSCHLÄGE:")
    print("="*70)
    
    error_msg = str(e).lower()
    
    if 'modulenicht gefunden' in error_msg or 'no module' in error_msg:
        print("- Fehlende Python-Abhängigkeit")
        print("- Versuchen Sie: pip install -r requirements.txt")
    elif 'trainings' in error_msg or 'json' in error_msg:
        print("- Problem mit Trainings-Daten")
        print("- Check ob training_master_optimized.json existiert")
        print("- Command: cd c:\\Users\\noah1\\Desktop\\NoahsKI\\noahski_improved")
        print("           python MEGA_TRAINING_SUPER_SCHLAU.py")
    else:
        print("- Unbekannter Fehler - siehe Stack Trace oben")
    
    sys.exit(1)

# Versuch 2: Starte Flask App
print("\n2️⃣  Starte Flask App...")
print("="*70 + "\n")

try:
    # Starte mit Fehlerausgabe
    app.app.run(
        host='localhost',
        port=5000,
        debug=True,
        use_reloader=False  # Verhindert double reload
    )
except KeyboardInterrupt:
    print("\n✅ Shutdown by user")
except Exception as e:
    print(f"\n❌ FEHLER beim Starten:")
    print(f"{type(e).__name__}: {e}")
    traceback.print_exc()
    sys.exit(1)