i get this error always which ever python library i use.
{
“errorMessage”: “Unable to import module ‘handler’: No module named ‘sklearn’”,
“errorType”: “Runtime.ImportModuleError”
}
Error --------------------------------------------------
Error: Invoked function failed
at AwsInvoke.log (/usr/local/lib/node_modules/serverless/lib/plugins/aws/invoke/index.js:105:31)
at AwsInvoke.tryCatcher (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/util.js:16:23)
at Promise._settlePromiseFromHandler (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:547:31)
at Promise._settlePromise (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:604:18)
at Promise._settlePromise0 (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:649:10)
at Promise._settlePromises (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/promise.js:729:18)
at _drainQueueStep (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:93:12)
at _drainQueue (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:86:9)
at Async._drainQueues (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:102:5)
at Immediate.Async.drainQueues [as _onImmediate] (/usr/local/lib/node_modules/serverless/node_modules/bluebird/js/release/async.js:15:14)
at processImmediate (internal/timers.js:445:21)
at process.topLevelDomainCallback (domain.js:135:15)
For debugging logs, run again after setting the "SLS_DEBUG=*" environment variable.
Your Environment Information ---------------------------
Operating System: darwin
Node Version: 13.5.0
Framework Version: 1.60.5
Plugin Version: 3.2.7
SDK Version: 2.2.1
Components Core Version: 1.1.2
Components CLI Version: 1.4.0
My S3 bucket contains the files.
Predict-price(zip folder uploaded in S3 and contains following files)
- sklearn
- scipy
- numpy
- joblib
- bin
- requirements.txt
- package.json
- package-lock.json
- model_predict_visit
- handler.py
- event.json
i am missing any files that should be uploaded.
sls invoke --function predict-price --path event.json (this is how invoke)