File size: 955 Bytes
f630bbd | 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 | #!/usr/bin/env python3
"""
Debug script to test module imports in Docker environment
"""
import sys
import os
# Print current working directory and Python path
print("Current working directory:", os.getcwd())
print("Python path:", sys.path)
print("Directory contents:", os.listdir('.'))
# Try to import the controller modules
try:
print("\nTrying direct imports...")
from controller.pix2text_controller import pix2text_bp
print("✅ Direct import successful")
except Exception as e:
print(f"❌ Direct import failed: {e}")
# Try alternative approach
try:
print("\nTrying alternative import approach...")
sys.path.insert(0, '.')
import controller.pix2text_controller as pix2text_module
pix2text_bp = pix2text_module.pix2text_bp
print("✅ Alternative import successful")
except Exception as e2:
print(f"❌ Alternative import also failed: {e2}")
print("\nTest completed.") |