AWS Glue Jupyter Notebook额外模块

0

【以下的问题经过翻译处理】 大家好,

我正在尝试使用Jupyter Notebook创建一个Glue作业,但是似乎无法导入外部模块。我按照这里的文档安装了外部模块https://docs.aws.amazon.com/glue/latest/ug/notebook-getting-started.html

%additional_python_modules s3://notebook-mod/simple_salesforce.whl

当我运行我的import statement单元格时,出现以下错误: Enter image description here

我有遗漏什么吗?谢谢!

profile picture
전문가
질문됨 5달 전23회 조회
1개 답변
0

【以下的回答经过翻译处理】 您好,

你已经使用了正确的方法在Glue Studio Notebook中安装了外部python模块,该笔记本使用了Glue2.0/Glue 3.0。

为了调查此问题,我按照以下步骤,在我的环境中进行了设置:

  1. 创建Glue Studio Notebook(导航到Glue Console-->在左侧面板单击Glue Studio-->选择Jupyter Notebook)
  2. 从pypi(https://files.pythonhosted.org/packages/60/3c/647da942ce0e1f024dc3e188ebc60ee28972ba1254e691e3512511b9062a/simple_salesforce-1.12.1-py2.py3-none-any.whl)下载simple-salesforce.whl文件并上传到s3
  3. 使用以下代码安装simple_salesforce
%additional_python_modules s3://library/simple_salesforce-1.12.1-py2.py3-none-any.whl)

from simple_salesforce import Salesforce

它执行成功了,没有发生任何问题。在您的情况下,我怀疑您正在使用由Glue Devendpoint支持的Sagemaker Notebook,它使用的是Glue 1.0,不支持additional_python_modules。请您再次检查并确认是否使用了正确的notebook。

参考:

[1] https://docs.aws.amazon.com/glue/latest/ug/notebook-getting-started.html

profile picture
전문가
답변함 5달 전

로그인하지 않았습니다. 로그인해야 답변을 게시할 수 있습니다.

좋은 답변은 질문에 명확하게 답하고 건설적인 피드백을 제공하며 질문자의 전문적인 성장을 장려합니다.

질문 답변하기에 대한 가이드라인