gpt4 book ai didi

没有为 aws sam cli 配置 Python

转载 作者:行者123 更新时间:2023-12-05 00:55:07 25 4
gpt4 key购买 nike

我正在按照本教程构建 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

那么我缺少什么以及如何解决这个问题?

最佳答案

python3 --version

找到解决方案。您可能已选择 python3.8/python3.7 作为应用程序的运行时。当系统的 python 版本不匹配时会发生错误。检查python版本:python3 --version并使用与系统python版本相同的应用程序运行时。

关于没有为 aws sam cli 配置 Python,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65366251/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com