无法在 aws 层中添加 pandas 并出现错误
Not able to add pandas in aws layer and getting error
我在 lambda 函数中导入 pandas/numpy 时出错:
我添加了 pandas/numpy 作为 aws 层,我也以同样的方式添加了 pymysql,它工作正常。
正在处理 windows 10,
在 lambda 中使用 python3.7 同样
使用 pip install pandas -t
构建 zip 包
在目录中 - python\lib\python3.7\site-packages
{
"errorMessage": "Unable to import module 'lambda_function': \n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy C-extensions failed. This error can happen for\nmany reasons, often due to issues with your setup or how NumPy was\ninstalled.\n\nWe have compiled some common reasons and troubleshooting tips at:\n\n https://numpy.org/devdocs/user/troubleshooting-importerror.html\n\nPlease note and check the following:\n\n * The Python version is: Python3.7 from \"/var/lang/bin/python3.7\"\n * The NumPy version is: \"1.19.1\"\n\nand make sure that they are the versions you expect.\nPlease carefully study the documentation linked above for further help.\n\nOriginal error was: No module named 'numpy.core._multiarray_umath'\n",
"errorType": "Runtime.ImportModuleError"
}
包的压缩应该在构建文件夹中完成,即使您将包安装在 site-packages
https://www.youtube.com/watch?v=zrrH9nbSPhQ - 有一些很好的步骤可以遵循。
Pandas 可能是一个巨大的 zip 文件,lambda 层可能不支持。您可能需要检查 pandas- 示例 pandas-xlrd.
我在 lambda 函数中导入 pandas/numpy 时出错:
我添加了 pandas/numpy 作为 aws 层,我也以同样的方式添加了 pymysql,它工作正常。
正在处理 windows 10,
在 lambda 中使用 python3.7 同样
使用 pip install pandas -t
构建 zip 包
在目录中 - python\lib\python3.7\site-packages
{
"errorMessage": "Unable to import module 'lambda_function': \n\nIMPORTANT: PLEASE READ THIS FOR ADVICE ON HOW TO SOLVE THIS ISSUE!\n\nImporting the numpy C-extensions failed. This error can happen for\nmany reasons, often due to issues with your setup or how NumPy was\ninstalled.\n\nWe have compiled some common reasons and troubleshooting tips at:\n\n https://numpy.org/devdocs/user/troubleshooting-importerror.html\n\nPlease note and check the following:\n\n * The Python version is: Python3.7 from \"/var/lang/bin/python3.7\"\n * The NumPy version is: \"1.19.1\"\n\nand make sure that they are the versions you expect.\nPlease carefully study the documentation linked above for further help.\n\nOriginal error was: No module named 'numpy.core._multiarray_umath'\n",
"errorType": "Runtime.ImportModuleError"
}
包的压缩应该在构建文件夹中完成,即使您将包安装在 site-packages https://www.youtube.com/watch?v=zrrH9nbSPhQ - 有一些很好的步骤可以遵循。
Pandas 可能是一个巨大的 zip 文件,lambda 层可能不支持。您可能需要检查 pandas- 示例 pandas-xlrd.