-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdebug_modules.py
More file actions
52 lines (47 loc) · 1.69 KB
/
debug_modules.py
File metadata and controls
52 lines (47 loc) · 1.69 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
#!/usr/bin/env python3
"""
Debugging script to check Python module structure in the container.
"""
import sys
import os
import pkgutil
print("Python path:")
for path in sys.path:
print(f" - {path}")
try:
import pseudoscribe
print("\npseudoscribe package:")
print(f" - Location: {pseudoscribe.__file__}")
print("\nSubpackages:")
for _, name, ispkg in pkgutil.iter_modules(pseudoscribe.__path__, pseudoscribe.__name__ + "."):
if ispkg:
print(f" - {name}")
try:
module = __import__(name)
print(f" - Loaded successfully")
except Exception as e:
print(f" - Failed to load: {str(e)}")
print("\nChecking specific modules:")
try:
import pseudoscribe.api
print(f" - pseudoscribe.api: {pseudoscribe.api.__file__}")
except Exception as e:
print(f" - pseudoscribe.api: Failed to import - {str(e)}")
try:
import pseudoscribe.infrastructure
print(f" - pseudoscribe.infrastructure: {pseudoscribe.infrastructure.__file__}")
except Exception as e:
print(f" - pseudoscribe.infrastructure: Failed to import - {str(e)}")
try:
import pseudoscribe.models
print(f" - pseudoscribe.models: {pseudoscribe.models.__file__}")
except Exception as e:
print(f" - pseudoscribe.models: Failed to import - {str(e)}")
print("\nChecking API app module:")
try:
from pseudoscribe.api import app
print(f" - app module: {app.__file__}")
except Exception as e:
print(f" - app module: Failed to import - {str(e)}")
except Exception as e:
print(f"Error importing pseudoscribe package: {str(e)}")