简体   繁体   中英

Runtime.ImportModuleError: Unable to import module 'testsdk': No module named 'jsonpickle' with Python script using AWS Lambda

My Python script has been tested on multiple local computers and works as expected. But when the script is zipped up and uploaded to AWS Lambda I get Runtime.ImportModuleError: Unable to import module 'testsdk': No module named 'jsonpickle' when I test the code. testsdk is the desired python file that should be executed.

The python version on my local PC is 3.7.0 which is the same Python version as AWS Lambda.

Any help with this would be much appreciated!

I faced the same issue and solved it by correcting the directory structure.

Inside the lambda function are two equal folder names. I fixed the issue by deleting the first folder.

目录结构

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM