broad-boots-9735
02/17/2026, 6:13 PMtall-airline-16756
02/17/2026, 6:14 PMtall-airline-16756
02/17/2026, 6:14 PMidlelib.debugobj → idlelib.tree → tkinter and the ImportError: libtk8.6.so), and that pinpoints the problem: the Docker image is missing the system Tk libraries that tkinter (pulled in via idlelib) requires.
What you can do next (two options):
1) If you want to keep the current code and satisfy Tkinter at build time
• Add the Tk system package to the Docker build so libtk8.6.so is available. Update the apt install step in your Dockerfile build stage to include tk-dev (or libtk8.6 / python3-tk if tk-dev isn’t present):
RUN apt-get update && apt-get install -y \
gcc \
g++ \
python3-dev \
tk-dev \
&& rm -rf /var/lib/apt/lists/*
If tk-dev isn’t available on that base image, try:
RUN apt-get update && apt-get install -y \
gcc \
g++ \
python3-dev \
libtk8.6 \
&& rm -rf /var/lib/apt/lists/*
Then rebuild. This makes libtk8.6.so available so the uv run src/agent.py download-files step can import tkinter successfully.
2) If you do NOT need any GUI/idle functionality (preferred for server/agent images)
• Remove the dependency on `idlelib`/`tkinter`. The import chain shows idlelib.debugobj is being imported somewhere in your code or a dependency. Search your project (and any local packages) for idlelib or tkinter imports and remove them if they’re accidental. Common causes:
◦ Debugging helpers or IDE-specific code left in src/agent.py
◦ A dependency that imports idlelib only for optional tooling
If you choose this route, remove or guard the import (for example, only import idlelib in a local dev script), then rebuild — no system Tk packages will be necessary.
Questions to help me guide you further
• Do you actually need any GUI/interactive features (idlelib/tkinter) in this agent container, or can we safely remove those imports?
• If you prefer installing the system packages, which base image are you using (I see `ghcr.io/astral-sh/uv:python3.13-bookworm-slim`) — I can give the exact apt package name that works for that image if you want.
Tell me which option you want to take and I’ll give the exact Dockerfile patch or the search/remove steps for the idlelib import.
Sources: Examples | livekit/livekit_composite | DeepWiki | examples/other | livekit/livekit_composite | DeepWikibroad-boots-9735
02/17/2026, 6:21 PM[build-system]
requires = ["setuptools>=61.0", "wheel"]
build-backend = "setuptools.build_meta"
[project]
name = "agent-starter-python"
version = "1.0.0"
description = "Simple voice AI assistant built with LiveKit Agents for Python"
requires-python = ">=3.10, <3.14"
dependencies = [
"livekit-agents[silero,turn-detector]~=1.3",
"livekit-plugins-noise-cancellation~=0.2",
"python-dotenv",
]
[dependency-groups]
dev = [
"pytest",
"pytest-asyncio",
"ruff",
]
[tool.setuptools.packages.find]
where = ["src"]
[tool.setuptools.package-dir]
"" = "src"
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
[tool.ruff]
line-length = 88
target-version = "py39"
[tool.ruff.lint]
select = ["E", "F", "W", "I", "N", "B", "A", "C4", "UP", "SIM", "RUF"]
ignore = ["E501"] # Line too long (handled by formatter)
[tool.ruff.format]
quote-style = "double"
indent-style = "space"
and this is livekit.toml
[project]
subdomain = "popai-alu42t1z"
[agent]
id = "CA_faN2XTRdDpjt"tall-airline-16756
02/17/2026, 6:21 PMsrc/agent.py imports idlelib.debugobj — start there.
2) Remove or guard the import in src/agent.py
• If you have a line like from idlelib.debugobj import dispatch or import idlelib, remove it.
• If you only need that code locally for debugging, wrap it so it won’t run during the Docker build:
import os
if os.environ.get("LOCAL_DEV") == "1":
from idlelib.debugobj import dispatch # only in local dev
• Or move that debug-only code into a separate script that isn’t run during build.
3) Check dependencies for accidental imports
• Your pyproject lists livekit-agents[silero,turn-detector] and livekit-plugins-noise-cancellation. If the grep finds no imports in your code, see if any local package in src/ imports idlelib. Built packages from PyPI rarely pull idlelib by default, so it’s likely in your own code.
4) Rebuild and verify
• Re-run your build/deploy command:
◦ lk agent deploy
• If the import is removed, the ImportError: libtk8.6.so should no longer appear and the uv run src/agent.py download-files step will complete.
If the grep shows nothing and the error persists
• Tell me the grep results and paste the top of src/agent.py (first ~40 lines). I’ll point out exactly which line to change or provide a minimal patch.