获取无服务器错误在 sls 部署中生成 python3.8 ENOENT 以满足 python 要求

Pan*_*arg 9 python amazon-web-services serverless

使用 sls deploy 进行无服务器部署并收到错误“spawn python3.8 ENOENT”

\n
ubuntu@jumpboxAndawscli:$ sudo sls deploy --stage prod\nServerless: Configuration warning at \xe2\x80\x98provider\xe2\x80\x99: unrecognized property \xe2\x80\x98configfile\xe2\x80\x99\nServerless:\nServerless: Learn more about configuration validation here:\nServerless:\nServerless: Updated deployment bucket public access block\nServerless: [serverless-package-external] is complete\nServerless: Generated requirements from /data/integrations/requirements.txt in /data/integrations/.serverless/requirements.txt\xe2\x80\xa6\nServerless: Installing requirements from /home/ubuntu/.cache/serverless-python-requirements/c83840509c18324c044b580033bb40d7104080235af12a1d9e3d118cf0675070_x86_64_slspyc/requirements.txt \xe2\x80\xa6\nServerless: Using download cache directory /home/ubuntu/.cache/serverless-python-requirements/downloadCacheslspyc\n\nError ---------------------------------------------------\n\nError: spawn python3.8 ENOENT\nat Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)\nat onErrorNT (internal/child_process.js:470:16)\nat processTicksAndRejections (internal/process/task_queues.js:84:21)\n\n For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.\nYour Environment Information ---------------------------\nOperating System: linux\nNode Version: 12.22.1\nFramework Version: 2.72.2\nPlugin Version: 5.5.4\nSDK Version: 4.3.1\nComponents Version: 3.18.2\n
Run Code Online (Sandbox Code Playgroud)\n

alp*_*das 6

您的本地可用 python(当前 PATH)版本必须与 serverless.yml 提供程序运行时值中配置的版本相同。


Pan*_*arg 0

对我来说,当我在 serverless.yml 中将 python 版本从 3.8 更改为 3.6 时,只有它才起作用。