在AWS Lambda中运行时,Numba会发出多处理UserWarning警告

问题描述 投票:0回答:1

[在AWS Lambda上使用numba运行脚本时,我总是收到此警告:

/var/task/numba/npyufunc/parallel.py:300: UserWarning: Could not obtain multiprocessing lock due to OS level error: Errno 38] Function not implemented

由于AWS Lambda不支持多重处理,有什么办法可以忽略此错误?

python aws-lambda numba suppress-warnings
1个回答
0
投票

将此代码添加到导入了lambda句柄的python文件中:

import warnings
warnings.filterwarnings(action='ignore', message='Could not obtain multiprocessing lock')

这将忽略该特定警告,同时仍打印脚本可能产生的任何其他警告。

© www.soinside.com 2019 - 2024. All rights reserved.