[ERROR] Runtime.ImportModuleError: Unable to import module 'lambda_function': No module named 'aws_xray_sdk'
- Dominant language
- Python
- Stars
- 338
- Forks
- 147
- PR merge metrics
- No merged PRs in 30d
Description
Hi,
I am using AWS Codestar to develop a python lambda function.
I added X-Ray support following https://docs.aws.amazon.com/codestar/latest/userguide/customize-project-xray.html and added pip install aws-xray-sdk to my buildspec.yml
# Upgrade AWS CLI to the latest version
- pip install --upgrade awscli
# Upgrade AWS X-Ray SDK
- pip install --upgrade aws-xray-sdk
Add instrumented my code as per https://docs.aws.amazon.com/lambda/latest/dg/python-tracing.html.
But CloudWatch Logs always show this error.
> START RequestId: f785062e-6687-496a-91a9-653e0127d2d0 Version: 8
>
> [ERROR] Runtime.ImportModuleError: Unable to import module 'lambda/s3_trigger_start_notebook_function': No module named 'aws_xray_sdk'
>
> END RequestId: f785062e-6687-496a-91a9-653e0127d2d0
>
> REPORT RequestId: f785062e-6687-496a-91a9-653e0127d2d0 Duration: 13.87 ms Billed Duration: 100 ms Memory Size: 128 MB Max Memory Used: 69 MB Init Duration: 293.24 ms
> XRAY TraceId: 1-5de586ab-3073f132c67bc0163d18fd9b SegmentId: 1ebd10451b253bf7 Sampled: true
>
There is no requirements.txt by default in CodeStar projects. What is missing here?
Contributor guide
Assessment
This issue has not been assessed yet.