使用 Pandas AWS Glue Python Shell 作业

Hug*_*ugo 2 python pandas aws-glue

AWS 文档 https://docs.aws.amazon.com/glue/latest/dg/add-job-python.html

提到

Python shell作业运行环境支持以下库:

...

pandas(需要通过 python setuptools 配置 setup.py 安装)

但它没有提到如何进行安装。

如何在 AWS Glue Python Shell 作业中使用 Pandas?

Hug*_*ugo 6

只是为了澄清桑迪普的答案,这对我有用

1/忽略AWS文档

2/ 创建一个 setup.py 文件,其中包含:

from setuptools import setup

setup(name="pandasmodule",
        version="0.1",
        packages=[],
        install_requires=['pandas==0.25.1']
    )
Run Code Online (Sandbox Code Playgroud)

3/ 在包含该文件的文件夹中运行此命令:

python setup.py bdist_wheel
Run Code Online (Sandbox Code Playgroud)

4/上传.whl文件到s3

5/ 将 Glue ETL 作业中的“Python lib 路径”配置为 s3 路径

您现在可以import pandas as pd在 Glue ETL 作业中使用“”