File size: 2,237 Bytes
fe24641
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env python3
"""Test script to verify all imports work correctly"""

import sys
import importlib

def test_imports():
    """Test that all required modules can be imported"""
    
    modules_to_test = [
        # External dependencies
        ('gradio', 'Gradio UI framework'),
        ('torch', 'PyTorch'),
        ('transformers', 'Transformers library'),
        ('diffusers', 'Diffusers library'),
        ('PIL', 'Pillow image library'),
        ('numpy', 'NumPy'),
        ('trimesh', 'Trimesh 3D library'),
        
        # Internal modules
        ('core.ai_pipeline', 'AI Pipeline'),
        ('core.game_mechanics', 'Game Mechanics'),
        ('core.state_manager', 'State Manager'),
        ('core.auth_manager', 'Auth Manager'),
        ('models.stt_processor', 'STT Processor'),
        ('models.text_generator', 'Text Generator'),
        ('models.image_generator', 'Image Generator'),
        ('models.model_3d_generator', '3D Model Generator'),
        ('models.rigging_processor', 'Rigging Processor'),
        ('ui.themes', 'UI Themes'),
        ('ui.interfaces', 'UI Interfaces'),
        ('utils.fallbacks', 'Fallback Manager'),
        ('utils.caching', 'Model Cache'),
    ]
    
    print("πŸ” Testing imports...\n")
    
    failed = []
    
    for module_name, description in modules_to_test:
        try:
            importlib.import_module(module_name)
            print(f"βœ… {description} ({module_name})")
        except ImportError as e:
            print(f"❌ {description} ({module_name}): {e}")
            failed.append((module_name, str(e)))
        except Exception as e:
            print(f"⚠️  {description} ({module_name}): Imported but with error: {e}")
    
    print("\n" + "="*50 + "\n")
    
    if failed:
        print(f"❌ {len(failed)} imports failed:")
        for module, error in failed:
            print(f"   - {module}: {error}")
        print("\nπŸ’‘ Install missing dependencies with: pip install -r requirements.txt")
        return False
    else:
        print("βœ… All imports successful!")
        print("\nπŸš€ You can now run: python app.py")
        return True

if __name__ == "__main__":
    success = test_imports()
    sys.exit(0 if success else 1)