【发布时间】:2023-01-04 10:58:56
【问题描述】:
我正在尝试按照本教程 (https://github.com/awslabs/lambda-opencv) 进行操作,但是在尝试测试我的 AWS lambda 函数(x86 架构)时,我总是遇到 numpy 错误。我把错误贴在下面:
Importing the numpy C-extensions failed. This error can happen for
many reasons, often due to issues with your setup or how NumPy was
installed.
We have compiled some common reasons and troubleshooting tips at:
https://numpy.org/devdocs/user/troubleshooting-importerror.html
Please note and check the following:
* The Python version is: Python3.9 from "/var/lang/bin/python3.9"
* The NumPy version is: "1.23.3"
and make sure that they are the versions you expect.
Please carefully study the documentation linked above for further help.
Original error was: No module named 'numpy.core._multiarray_umath'
使用 M1 macbook 运行 README 中的命令会影响事情吗?我也尝试过 pip3 将 cv2 (4.6.0.66) 和 numpy (1.23.3) 安装到压缩包中,但这仍然会产生相同的错误(功能使用 arm 架构)。我注意到,当我有一个 x86 架构的函数时,我可以使用来自 Klayers (https://github.com/keithrozario/Klayers) 的 arn 来克服 numpy 错误,但是我有一个 opencv 错误显示在这里:
Unable to import module 'lambda_function': /opt/python/lib/python3.9/site-packages/cv2/cv2.abi3.so: invalid ELF header
有谁知道如何获得使用图层的教程中的功能?任何帮助表示赞赏。
【问题讨论】:
-
this 有帮助吗?
标签: python amazon-web-services numpy opencv