【发布时间】:2021-03-29 15:38:08
【问题描述】:
我正在按照本教程构建一个 SAM 应用程序:https://docs.aws.amazon.com/serverless-application-model/latest/developerguide/serverless-getting-started-hello-world.html
当我执行sam build 时,出现以下错误
❯ sam build
Building codeuri: hello_world/ runtime: python3.8 metadata: {} functions: ['HelloWorldFunction']
Build Failed
Error: PythonPipBuilder:Validation - Binary validation failed for python, searched for python in following locations : ['/usr/bin/python'] which did not satisfy constraints for runtime: python3.8. Do you have python for runtime: python3.8 on your PATH?
我通过这样做检查了我的 python
❯ which python
python: aliased to python3
当我做 python 版本时,我得到了这个
❯ python --version
Python 3.8.2
那么我缺少什么以及如何解决这个问题?
【问题讨论】:
-
一些想法 here 检查你的 template.yaml 中的运行时并考虑重新安装 awscli 和 sam
-
已经验证了python版本。现在正在卸载所有 pythons/aws-cli 和 sam cli
-
@EmAe 如果这解决了您的问题,请写下您自己问题的答案并接受它。这是允许的。请参阅帮助中心"Can I answer my own question?"。
标签: python amazon-web-services aws-lambda serverless aws-sam