Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Py3: Can't open file /snapshot/serverless/lib/plugins/aws/invokeLocal/invoke.py : No such file or directory

I am trying to test the serverless lambda function locally using the command Command

serverless invoke local -f send --log --stage test

Error

python3: can't open file '/snapshot/serverless/lib/plugins/aws/invokeLocal/invoke.py': [Errno 2] No such file or directory

This command is run inside the directory which has serverless.yml, requirements.txt, handler.py.

Unable to understand why this error occurs and what's the solution

like image 220
Chaitanya Bapat Avatar asked Feb 28 '20 18:02

Chaitanya Bapat


1 Answers

I had the same error. The result of my serverless --version command is

Framework Core: 1.66.0 (standalone)
Plugin: 3.4.1
SDK: 2.3.0
Components: 2.22.3

Solution

First, if you installed with the command of curl -o- -L https://slss.io/install | bash, uninstall it with the following command:

serverless uninstall

Next, install with the following command:

npm install -g [email protected]
npm bin serverless

Now the serverless --version command looks like this:

1.43.0

that's all

like image 75
kambe Avatar answered Oct 05 '22 22:10

kambe