[Python] Unable to test lambda function successfully to connect to OpenAI with API key using...

Discussão em 'Python' iniciado por Stack, Junho 6, 2025.

  1. Stack

    Stack Membro Participativo

    I have created a lambda function in AWS using python to connect to OpenAI using openai api key.The function doesn't test successfully as it gives error no module named _pydantic_core.

    I have installed and compiled all the package dependencies such as openai and pydantic-core and uploaded the zip file as layer.have compared and checked the runtime,they are also same.python runtime used is 3.11 for both AWS and locally using wsl.I have used wsl for dependent package compilation.

    There are two layers which are added to the function.first one has all the packages including the .py file except pydantic_core.second layer contains pydantic_core.

    But still it gives the same error.I am using AWS and wsl on windows 11 system.

    Continue reading...

Compartilhe esta Página