Skip to content
sistemo.io beta

Install packages

Agent code usually needs third-party libraries. Install them inside the sandbox, then run code that uses them — all in the same VM so the install persists.

Python (pip)

from sistemo import Sandbox

with Sandbox(stack="python") as sb:
    sb.run("pip install requests", timeout=180)
    r = sb.run("python3 -c 'import requests; print(requests.__version__)'")
    print(r.stdout)
import { Sandbox } from "@sistemo/sdk";

const sb = await Sandbox.create({ stack: "python" });
try {
  await sb.run("pip install requests", 180);
  console.log((await sb.run("python3 -c 'import requests; print(requests.__version__)'")).stdout);
} finally {
  await sb.close();
}

Node (npm)

from sistemo import Sandbox

with Sandbox(stack="node") as sb:
    sb.run("npm install -g cowsay", timeout=180)
    print(sb.run("cowsay hello").stdout)

Install from a requirements file

Write the file into the VM, then install from it:

from sistemo import Sandbox

with Sandbox(stack="python") as sb:
    sb.run("cat > /tmp/requirements.txt <<'EOF'\nrequests\nEOF")
    sb.run("pip install -r /tmp/requirements.txt", timeout=180)
    print(sb.run("python3 -c 'import requests; print(requests.__version__)'").stdout)

Pick the right base image

The base image already has Python and Node. Use a language-specific image for a leaner start:

stack Has
base (default) Python + Node
python Python toolchain
node Node.js toolchain
debian13 / ubuntu26.04 OS only — install what you need
ai base + uv, ripgrep, jq, bun

See Images for the full catalog.

Reuse, don't reinstall

Installs live for the life of the sandbox. Keep one sandbox alive across an agent session instead of reinstalling each call. To carry installed state between sandboxes, use volumes — see Persist data with volumes.