Lambda HelloWorld sample : "Error PythonPipBuilder:ResolveDependencies - 'utf-8' codec can't decode byte" running sam build

0

I am just trying to build the HelloWork lambda function from AWS. The only change I made is the python version : Runtime: python3.12 instead of 3.9 in the original template.yaml file. I got all the others files from the "sam init". When I try to build I get the following message: Starting Build use cache Manifest file is changed (new hash: 3298f13049d19cffaa37ca931dd4d421) or dependency folder (.aws-sam\deps\ffa173cf-c2b2-47e6-abaf-7aeb5e83ac61) is missing for (HelloWorldFunction), downloading dependencies and copying/building
source Building codeuri: C:\Workspace\Synapps\batch\aws\sam-app\hello_world runtime: python3.12 metadata: {} architecture: x86_64 functions: HelloWorldFunction Running PythonPipBuilder:CleanUp Running PythonPipBuilder:ResolveDependencies

Build Failed Error: PythonPipBuilder:ResolveDependencies - 'utf-8' codec can't decode byte 0xe9 in position 1348: invalid continuation byte

CONTEXT : Windows 11 Professional, IntelliJ, SAM CLI, version 1.112.0

Remiby
질문됨 7달 전565회 조회
3개 답변
0

Try cleaning the build cache and re-building:

sam build --no-cached --debug
profile picture
전문가
답변함 7달 전
0

The error indicates an issue with encoding when resolving dependencies for the Python 3.12 runtime.

  • Ensure your system and Docker installation meet the requirements for Python 3.12, such as Docker version 20.10.10 or higher.
  • Verify the SAM CLI version is recent enough to support Python 3.12.
  • Check if installing dependencies directly with pip install -r requirements.txt inside a Docker container with the Python 3.12 image has the same issue.
  • Try simplifying the template to use a minimal "Hello World" type function without external dependencies at first.
  • Consider creating a Lambda layer with your dependencies instead of including them directly in the deployment package.

The Python 3.12 runtime made some changes to return Unicode strings directly instead of escaped sequences, which may cause compatibility issues if other components expect the previous behavior. Updating dependent systems, packages or code to support the new return format could help resolve the problem.

profile picture
전문가
답변함 7달 전
0

I don't know if it will help, but I used the sam build command in the folder created after sam init and received the above error. My solution is I deleted the contents in the requirements.txt file and built it. It ran without problem.

답변함 한 달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인

관련 콘텐츠