Agent deployment error: 'package @livekit/agents not found' for Python agent

This question originally came up in our Slack community and the thread has been consolidated here for long-term reference.

I’m trying to deploy my Python agent to LiveKit Cloud with the latest CLI, but I’m getting the following error:

lk agent create
Using project [my-project]
Creating new agent
Using secrets file [.env]
Detected project type [node]
Using existing Dockerfile
package @livekit/agents not found in any project files

Why is it detecting the project type as ‘node’ when it’s a Python agent?

If you have a package.json file in the same directory as your Python agent, the CLI may incorrectly detect the project type as ‘node’.

To fix this, either:

  1. Remove the package.json file from the directory
  2. Use the --skip-sdk-check flag when running the command to bypass this check