Skip to content

Commit 1e9debf

Browse files
davila7claude
andcommitted
Add debugging info to E2B launcher script
- Print Python executable and path information - Auto-install E2B if import fails - Better error messages for troubleshooting 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
1 parent 589c7a4 commit 1e9debf

File tree

1 file changed

+28
-1
lines changed

1 file changed

+28
-1
lines changed

cli-tool/components/sandbox/e2b/e2b-launcher.py

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,34 @@
77
import os
88
import sys
99
import json
10-
from e2b import Sandbox
10+
11+
# Debug: Print Python path information
12+
print(f"Python executable: {sys.executable}")
13+
print(f"Python version: {sys.version}")
14+
print(f"Python path: {sys.path[:3]}...") # Show first 3 paths
15+
16+
try:
17+
from e2b import Sandbox
18+
print("✓ E2B imported successfully")
19+
except ImportError as e:
20+
print(f"✗ E2B import failed: {e}")
21+
print("Trying to install E2B...")
22+
import subprocess
23+
result = subprocess.run([sys.executable, '-m', 'pip', 'install', 'e2b'],
24+
capture_output=True, text=True)
25+
print(f"Install result: {result.returncode}")
26+
if result.stdout:
27+
print(f"Install stdout: {result.stdout}")
28+
if result.stderr:
29+
print(f"Install stderr: {result.stderr}")
30+
31+
# Try importing again
32+
try:
33+
from e2b import Sandbox
34+
print("✓ E2B imported successfully after install")
35+
except ImportError as e2:
36+
print(f"✗ E2B still failed after install: {e2}")
37+
sys.exit(1)
1138

1239
# Try to import and use dotenv if available, but don't fail if it's not
1340
try:

0 commit comments

Comments
 (0)