这个错误通常在 AWS Glue 环境中发生,它指出 AWS Glue 找不到一个名为 _imaging 的特定 PIL 库。这个错误的解决方法是在 AWS Glue 的 Python Shell Job 中手动安装所需的 PIL 库。
以下是一些示例代码,以帮助您解决这个问题:
import sys
!{sys.executable} -m pip install Pillow
或者:
import os
os.system('pip install Pillow')
这会使用 Python 的 pip 工具将 Pillow 库安装到 AWS Glue 环境中。想要了解更多 AWS Glue 的问题和解决方案,请参阅 AWS Glue 文档。