15:12:41.378 INFO … livekit.agents Finished do...
# ask-ai
b
151241.378 INFO … livekit.agents Finished downloading files for livekit.plugins.turn_detector (.venv) wesley@wesley:~/Documents/projects/popai/voice-agent-demo/demo$ lk agent deploy Using project [pb] Using agent [CA_faN2XTRdDpjt] Detected agent language [python.uv] [+] Building 30.6s (15/15) FINISHED => [internal] load remote build context 0.1s => copy /context / 0.1s => resolve image config for docker-image://docker.io/docker/dockerfile:1 0.1s => CACHED docker-image://docker.io/docker/dockerfile:1@sha256:b6afd42430b15f2d2a4c5a02b919e98a525b785b1aaff16747d2f623364e39b6 0.0s => => resolve docker.io/docker/dockerfile:1@sha256:b6afd42430b15f2d2a4c5a02b919e98a525b785b1aaff16747d2f623364e39b6 0.0s => [internal] load metadata for ghcr.io/astral-sh/uv:python3.13-bookworm-slim 0.1s => [ 1/10] FROM ghcr.io/astral-sh/uv:python3.13-bookworm-slim@sha256:531f855bda2c73cd6ef67d56b733b357cea384185b3022bd09f05e002cd144ca 0.0s => => resolve ghcr.io/astral-sh/uv:python3.13-bookworm-slim@sha256:531f855bda2c73cd6ef67d56b733b357cea384185b3022bd09f05e002cd144ca 0.0s => CACHED [ 2/10] RUN adduser --disabled-password --gecos "" --home "/app" --shell "/sbin/nologin" --uid "10001" appuser 0.0s => CACHED [ 3/10] RUN apt-get update && apt-get install -y gcc g++ python3-dev && rm -rf /var/lib/apt/lists/* 0.0s => CACHED [ 4/10] WORKDIR /app 0.0s => CACHED [ 5/10] COPY pyproject.toml uv.lock ./ 0.0s => CACHED [ 6/10] RUN mkdir -p src 0.0s => CACHED [ 7/10] RUN uv sync --locked 0.0s => [ 8/10] COPY . . 0.1s => [ 9/10] RUN chown -R appuser:appuser /app 26.5s => ERROR [10/10] RUN uv run src/agent.py download-files 1.1s ------ > [10/10] RUN uv run src/agent.py download-files: 0.254 Building agent-starter-python @ file:///app 0.985 Built agent-starter-python @ file:///app 0.998 Uninstalled 1 package in 10ms 0.999 Installed 1 package in 1ms 1.059 Traceback (most recent call last): 1.059 File "/app/src/agent.py", line 4, in <module> 1.059 from idlelib.debugobj import dispatch 1.059 File "/usr/local/lib/python3.13/idlelib/debugobj.py", line 15, in <module> 1.059 from idlelib.tree import TreeItem, TreeNode, ScrolledCanvas 1.059 File "/usr/local/lib/python3.13/idlelib/tree.py", line 19, in <module> 1.059 from tkinter import * 1.059 File "/usr/local/lib/python3.13/tkinter/__init__.py", line 38, in <module> 1.059 import _tkinter # If this fails your Python may not be configured for Tk 1.059 ^^^^^^^^^^^^^^^ 1.059 ImportError: libtk8.6.so: cannot open shared object file: No such file or directory ------ unable to deploy agent: build failed for iad.ocir.io/axyci3pr8vxm/production-cloud-agents:p-mfd71j7pvi7-ca-fan2xtrddpjt-v20260217181255: failed to solve: process "/bin/sh -c uv run src/agent.py download-files" did not complete successfully: exit code: 1 (.venv) wesley@wesley:~/Documents/projects/popai/voice-agent-demo/demo$
t
Thanks for reaching out, Wesley. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I reviewed the build output you pasted (the error chain from
idlelib.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):
Copy code
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:
Copy code
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 | DeepWiki
b
I dont need any of that. this is pyproject.toml
Copy code
[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
Copy code
[project]
  subdomain = "popai-alu42t1z"

[agent]
  id = "CA_faN2XTRdDpjt"
t
Thanks — and thanks for sharing the files. Since you don’t need any GUI/idle functionality, the cleanest fix is to remove whatever is importing `idlelib`/`tkinter` so the build no longer requires the Tk system libs. What to do next (quick checklist and exact steps) 1) Search for the import • Run this in your project root: ◦ grep -R "idlelib" -n . ◦ grep -R "tkinter" -n . • This will show which file(s) import them. The build trace showed
src/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:
Copy code
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.