[Python] SST Python Lambda Deployment Error "No pyproject.toml found"

Discussão em 'Python' iniciado por Stack, Abril 20, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to deploy an SST v3 application with a Python Lambda function for data clustering, I have two TypeScript Lambdas that are working correctly but the Python Lambda is constantly getting this error:

    Build Error packages/python_functions/src/clustering.handler
    ↳ failed to run uv sync: exit status 2
    error: No `pyproject.toml` found in current directory or any parent directory


    I have tried placing the pyproject.toml file in different locations (project root, packages/python_functions and packages/python_functions/src). I have tried using requirements.txt file instead of the pyproject.toml file but get the same error.

    Here is the relevant code in the sst config file:

    clusteringQueue.subscribe({
    handler: "packages/python_functions/src/clustering.handler",
    timeout: "10 minutes",
    runtime: "python3.11",
    environment: {
    SUPABASE_URL: process.env.SUPABASE_URL!,
    SUPABASE_SERVICE_ROLE_KEY: process.env.SUPABASE_SERVICE_ROLE_KEY!,
    OPENAI_API_KEY: process.env.OPENAI_API_KEY!,
    },
    });


    How can I properly configure SST v3 to recognise and use the Python dependencies in my pyproject.toml when deploying this Lambda function?

    Continue reading...

Compartilhe esta Página