victorious-parrot-13088
08/04/2025, 1:48 PMModuleNotFoundError: No module named 'livekit.agents.voice_assistant' even after successful pip install
Description:
I am unable to import livekit.agents.voice_assistant despite a seemingly successful installation of the livekit-agents package. I have followed all standard troubleshooting steps, including creating multiple fresh virtual environments with different Python versions, clearing pip's cache, and confirming the livekit/agents folder exists. The installation logs indicate all requirements are satisfied and the package is installed, but the necessary voice_assistant.py file appears to be missing from the livekit/agents directory.
Steps to Reproduce:
1. Created a new virtual environment using Python 3.11: py -3.11 -m venv venv311
2. Activated the environment: .\venv311\Scripts\activate
3. Installed livekit-agents and `python-dotenv`: pip install livekit-agents python-dotenv
4. Ran my script `main.py`: python main.py start
5. The script fails with a ModuleNotFoundError for livekit.agents.voice_assistant.
6. Upon manual inspection of the venv311\Lib\site-packages\livekit\agents directory, the voice_assistant.py file is missing.
Expected Behavior:
The livekit-agents package should install correctly, including the voice_assistant.py file, and allow the from livekit.agents.voice_assistant import VoiceAssistant statement to succeed.
Actual Behavior:
The pip install command reports success, but the voice_assistant.py file is not created in the expected directory, leading to a ModuleNotFoundError.
System Information:
• Operating System: Windows [Please specify your version, e.g., 10 or 11]
• Python Version: 3.11.8 (as well as experiencing the same issue with 3.12 and 3.13)
• livekit-agents version: 1.2.2 (as reported by pip)
• pip version: 25.2tall-airline-16756
08/04/2025, 1:48 PMtall-airline-16756
08/04/2025, 1:48 PMModuleNotFoundError for livekit.agents.voice_assistant, please follow these steps:
1. Reinstall the LiveKit Agents Package: Run the following command to ensure all required dependencies are installed: pip install "livekit-agents[deepgram,openai,cartesia,silero,turn-detector]~=1.0" "livekit-plugins-noise-cancellation~=0.2" "python-dotenv"
2. Verify Python Version: Ensure you are using Python 3.9 or later, as required by LiveKit Agents.
3. Create and Configure a .env File: Add the necessary credentials for your AI providers and LiveKit server in a .env file: `DEEPGRAM_API_KEY=<your_deepgram_api_key>
OPENAI_API_KEY=<your_openai_api_key>
CARTESIA_API_KEY=<your_cartesia_api_key>
LIVEKIT_API_KEY=<your_api_key>
LIVEKIT_API_SECRET=<your_api_secret>
LIVEKIT_URL=<your_livekit_server_url>`Replace the placeholders with your actual API keys and server URL.
4. Verify Python Path: Ensure the Python environment where you installed the package is the same one being used to run your code. If using a virtual environment, make sure it is activated.
5. Check Module Import: Confirm that your code imports the module correctly and that the required class or function is available in the installed version.
If the issue persists, please share additional details, such as the exact code causing the error and the output of pip list to confirm the installed package versions.
Sources: Voice AI quickstart | LiveKit Docs