i continue to recieve this error whenever attempti...
# ask-ai
b
i continue to recieve this error whenever attempting to deploy livekit with the liveavatar plugin -> (bithuman) hasanslater@Hasans-MacBook-Pro-2 agent_private % lk agent deploy Using project [mixio] Using agent [CA_u4w3wc68G2Fk] [+] Building 22.0s (12/12) FINISHED => [internal] load remote build context 3.5s => copy /context / 9.0s => [internal] load metadata for docker.io/library/python:3.13.1-slim 0.1s => [1/9] FROM docker.io/library/python:3.13.1-slim@sha256:031ebf3cde9f3719d2db385233bcb18df5162038e9cda20e64e08f49f4b47a2f 0.0s => => resolve docker.io/library/python:3.13.1-slim@sha256:031ebf3cde9f3719d2db385233bcb18df5162038e9cda20e64e08f49f4b47a2f 0.0s => CACHED [2/9] WORKDIR /app 0.0s => CACHED [3/9] RUN apt-get update && apt-get install -y --no-install-recommends libatomic1 && apt-get clean && rm -rf /v 0.0s => CACHED [4/9] RUN pip install uv 0.0s => CACHED [5/9] RUN uv venv /app/venv 0.0s => CACHED [6/9] COPY requirements.txt . 0.0s => CACHED [7/9] RUN uv pip install -r requirements.txt --upgrade && uv pip uninstall opencv-python && uv pip install opencv-p 0.0s => [8/9] COPY agent.py . 4.3s => ERROR [9/9] RUN python agent.py download-files 4.1s ------ > [9/9] RUN python agent.py download-files: 3.752 Traceback (most recent call last): 3.753 File "/app/agent.py", line 9, in <module> 3.753 from livekit.plugins import liveavatar 3.753 ImportError: cannot import name 'liveavatar' from 'livekit.plugins' (unknown location) ------ unable to deploy agent: build failed for iad.ocir.io/axyci3pr8vxm/production-cloud-agents:p-5cdelorzq4r-ca-u4w3wc68g2fk-v20251226180249: failed to solve: process "/bin/sh -c python agent.py download-files" did not complete successfully: exit code: 1 (bithuman) hasanslater@Hasans-MacBook-Pro-2 agent_private %
t
Thanks for reaching out, Hasan. I'm an AI assistant and I'm here to help. Give me a moment while I research this topic.
Thanks — I see the ImportError happening when Docker runs `python agent.py download-files`:
cannot import name 'liveavatar' from 'livekit.plugins'
. That means the LiveAvatar plugin isn't installed inside the container where the agent runs. To fix this, please add the LiveAvatar extra to the environment used in your Docker build. Two quick options — pick whichever matches your build: • If you use requirements.txt, add:
Copy code
livekit-agents[liveavatar]~=1.3.6
then rebuild. • Or add an install step in your Dockerfile before running `agent.py`:
Copy code
RUN uv pip install "livekit-agents[liveavatar]~=1.3.6"
Checks to confirm: • No typos in package name or in
from livekit.plugins import liveavatar
. • The installed
livekit-agents
version is compatible with your code. If you share your Dockerfile or requirements.txt (or tell me whether you use `uv`/venv/poetry), I can give the exact lines to add and a short Dockerfile snippet you can paste. Sources: LiveAvatar virtual avatar integration guide | LiveKit docs | Hedra Realtime Avatar integration guide | LiveKit docs | Tavus virtual avatar integration guide | LiveKit docs | bitHuman virtual avatar integration guide | LiveKit docs
b
ARG PYTHON_VERSION=3.13.1 FROM python:${PYTHON_VERSION}-slim ENV PYTHONUNBUFFERED=1 WORKDIR /app # Install system dependencies # libgl1 libglib2.0-0 RUN apt-get update && \ apt-get install -y --no-install-recommends libatomic1 && \ apt-get clean && \ rm -rf /var/lib/apt/lists/* # Install uv RUN pip install uv # Create virtual environment RUN uv venv /app/venv ENV PATH="/app/venv/bin:$PATH" # Copy requirements and install dependencies COPY requirements.txt . RUN uv pip install "livekit-agents[liveavatar]~=1.3.6" RUN uv pip install -r requirements.txt --upgrade && \ uv pip uninstall opencv-python && \ uv pip install opencv-python-headless --no-deps # Copy application code COPY agent.py . # Ensure that any dependent models are downloaded at build-time RUN python agent.py download-files # Run the application ENTRYPOINT ["python", "agent.py"] CMD ["start"]
python-dotenv bithuman==0.5.25 elevenlabs livekit-agents[openai,silero,deepgram,cartesia,turn-detector,bithuman, elevenlabs, google, tavus, liveavatar]==1.3.6 livekit-agents[liveavatar]~=1.3.6
t
Thanks — I reviewed your Dockerfile. You already install
livekit-agents[liveavatar]~=1.3.6
, so the ImportError suggests the plugin still isn't available when
python agent.py download-files
runs. Two likely causes and fixes: 1) Ensure the venv is active for every `uv pip`/`python` call in the Docker build • Replace
RUN python agent.py download-files
with:
Copy code
RUN /app/venv/bin/python agent.py download-files
This guarantees the build-time Python uses the same virtualenv where
uv venv
installed packages. 2) Install the plugin via requirements (optional alternative) • Add the extra to
requirements.txt
(or ensure it's installed before download step), e.g.:
Copy code
livekit-agents[liveavatar]~=1.3.6
and then:
Copy code
RUN uv pip install -r requirements.txt --upgrade
before running
download-files
. Recommended minimal change (apply this and rebuild): • Change the download step to call the venv python:
Copy code
RUN /app/venv/bin/python agent.py download-files
If the error persists, please paste the output of: •
RUN /app/venv/bin/pip show livekit-agents
(as a Dockerfile RUN line) and • the top of
agent.py
(first ~20 lines) so I can confirm the import path.
Thanks — I see what you’ve provided: your Dockerfile already runs
uv pip install "livekit-agents[liveavatar]~=1.3.6"
but your requirements list also includes a long
livekit-agents[...]==1.3.6
line that contains
liveavatar
plus a separate
livekit-agents[liveavatar]~=1.3.6
. This can cause conflicting installs or pip resolution oddities during the build. What to do next (pick one): 1) Simplest — move the plugin into requirements.txt and remove the separate install line: • In requirements.txt keep one entry:
Copy code
livekit-agents[openai,silero,deepgram,cartesia,turn-detector,bithuman,elevenlabs,google,tavus,liveavatar]==1.3.6
• Remove the
RUN uv pip install "livekit-agents[liveavatar]~=1.3.6"
line from the Dockerfile. • Rebuild. 2) Or keep Dockerfile install and simplify requirements.txt so it does NOT re-declare livekit-agents (avoid duplicate/conflicting declarations). For example remove the long
livekit-agents[...]==1.3.6
line from requirements.txt and leave other packages (python-dotenv, bithuman, elevenlabs) there. Additional checks after changing: • Build the image and verify
pip list
inside the image includes
livekit-agents
and the plugin subpackage (same version). • Ensure no stray spaces or extra commas in the extras list (e.g.,
..., bithuman, elevenlabs, google, ...
should not include duplicate spacing or trailing commas). • If the import still fails, share the output of running inside the built image: a. docker run --rm -it <image> /bin/sh b. python -c "import pkgutil, importlib; print('livekit-agents' in [p.name for p in pkgutil.iter_modules()]); import importlib; print(importlib.import_module('livekit.plugins'))" (I can help interpret the output.) Tell me which option you prefer or paste your updated requirements.txt and I’ll give the exact Dockerfile edits to use.