livekit / python-sdks

LiveKit real-time and server SDKs for Python
https://docs.livekit.io
Apache License 2.0
123 stars 37 forks source link

ImportError: cannot import name 'codecs' #210

Closed parshvadaftari closed 1 week ago

parshvadaftari commented 3 months ago

When I run the minimal_assistant.py, this was the error that showed up. ImportError: cannot import name 'codecs' from 'livekit.agents' (/Users/parshva/SoftmaxAI/Projects/.conda/lib/python3.10/site-packages/livekit/agents/init.py)

It's a package issue, where instead of -> from livekit.agents import codecs, tts, utils

it should be: -> from livekit.agents.utils import codecs -> from livekit.agents import tts, utils

Doing this changes in my local stt.py and tts.py helped me to run the file. I suggest to update the pypi package as the 'codecs' is in "livkit.agents.utils" and not in "livekit.agents"