Understanding execution environments in PandaAGI SDK
LocalEnv
executes operations directly on the host filesystem within a specified base directory:
DockerEnv
runs operations inside a Docker container for better isolation:
E2BEnv
executes operations in a secure cloud-based sandbox using the E2B Code Interpreter SDK, providing strong isolation without requiring Docker:
Environment Selection
Error Handling
python result = await env.exec_shell("command") if result["status"] != "success": logger.error(f"Command failed: {result.get("message", result.get("stderr"))}") return # Process successful result print(result["stdout"])
Path Management
Docker Container Issues
Port Conflicts
Process Management