繁体   English   中英

在 Lambdas 中使用层无法导入名为“x”的模块 -(该模块在我的层中)

[英]Using a Layer within Lambdas failed to import module named 'x' - (This module is in my Layer)

我已经使用此处的说明为 Lambdas 构建了一个层。 我要添加的 package 是:selenium-wire

当我测试我的 Lambda 时,我得到了这个:

[错误] Runtime.ImportModuleError:无法导入模块“lambda_function”:没有名为“seleniumwire”的模块 Traceback(最近一次调用最后一次):

有任何想法吗?

我已经尝试在导入 seleniumwire 的文件夹中包含 selenium-wire 的 package 内容,但给我一个指向无效 ELF 的错误,这导致我使用上面链接的说明。

您可以使用:

[...]$ git clone https://github.com/bluegridio/build-lambda-layer.git
[...]$ cd build-lambda-layer
[...]$ ./build-lambda-layer.sh selenium-wire

查看:

[...]$ unzip -l selenium-wire.zip python/lib/python3.7/site-packages/seleniumwire/

Archive:  selenium-wire.zip
  Length      Date    Time    Name
---------  ---------- -----   ----
        0  2023-01-31 08:18   python/lib/python3.7/site-packages/seleniumwire/
---------                     -------
        0                     1 file
暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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