SLS Deploy Error in Python: Error: spawn python3.8 ENOENT

ubuntu@jumpboxAndawscli:/data/integrations$ sudo sls deploy --stage prod
Serverless: Configuration warning at ‘provider’: unrecognized property ‘configfile’
Serverless:
Serverless: Learn more about configuration validation here:
Serverless:
Serverless: Using deployment bucket ‘prod-sls-deployments’
Serverless: Updated deployment bucket public access block
Serverless: [serverless-package-external] is complete
Serverless: Generated requirements from /data/integrations/requirements.txt in /data/integrations/.serverless/requirements.txt…
Serverless: Installing requirements from /home/ubuntu/.cache/serverless-python-requirements/c83840509c18324c044b580033bb40d7104080235af12a1d9e3d118cf0675070_x86_64_slspyc/requirements.txt …
Serverless: Using download cache directory /home/ubuntu/.cache/serverless-python-requirements/downloadCacheslspyc

Error ---------------------------------------------------

Error: spawn python3.8 ENOENT
at Process.ChildProcess._handle.onexit (internal/child_process.js:268:19)
at onErrorNT (internal/child_process.js:470:16)
at processTicksAndRejections (internal/process/task_queues.js:84:21)

 For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.

Your Environment Information ---------------------------
Operating System: linux
Node Version: 12.22.1
Framework Version: 2.72.2
Plugin Version: 5.5.4
SDK Version: 4.3.1
Components Version: 3.18.2

1 Like

I do have the same problem :S
Did you figure it out?

Problem for me was than Python version installed in my Docker container was
FROM python:3.9-slim-buster

but in serverless.yml provider referenced
runtime: python3.8

changed container version to
FROM python:3.8-slim-buster
and happy thereafter (quite slow deployment though)

Problem for me was resolved when I changed the python version to 3.6

I also solved it, seems you can not use python 3.10 to run the plugin.
I recorded the steps in case I need to review on the future, here they are in case someone is stuck: Setup Plugin Serverless Python Requirements - YouTube

I also got this and resolved in a similar way. It’s a real shame we can’t use python 3.10 to run the plugin even if the runtime of the function itself is a supported version like 3.8 etc.

After I resolved this I then spent ages grappling with this for ages as well! serverless deploy -> Exited with code 1 · Issue #663 · serverless/serverless-python-requirements · GitHub

I think there is a problem with the Docker image for python 3.8. I got it working by setting dockerizePip to false

Hi @MagicJF I am also expecting such video for perfect solution.
Thanks