Shi*_*ary 3 amazon-web-services aws-glue
我正在尝试使用 python 在 AWSglue 中运行 ETL 作业,脚本是
import sys
from awsglue.transforms import *
from awsglue.utils import getResolvedOptions
from pyspark.context import SparkContext
from awsglue.context import GlueContext
from awsglue.job import Job
glueContext = GlueContext(SparkContext.getOrCreate())
person = glueContext.create_dynamic_frame.from_catalog(
database="test",
table_name="testetl_person")
person.printSchema()
Run Code Online (Sandbox Code Playgroud)
此脚本正在 AWS 开发端点中运行,并且在运行作业时会引发以下异常
File "/tmp/runscript.py", line 118, in <module>
runpy.run_path(temp_file_path, run_name='__main__')
File "/usr/local/lib/python3.6/runpy.py", line 263, in run_path
pkg_name=pkg_name, script_name=fname)
File "/usr/local/lib/python3.6/runpy.py", line 96, in _run_module_code
mod_name, mod_spec, pkg_name, script_name)
File "/usr/local/lib/python3.6/runpy.py", line 85, in _run_code
exec(code, run_globals)
File "/tmp/glue-python-scripts-cf4xyag5/test.py", line 2, in <module>
ModuleNotFoundError: No module named 'awsglue.transforms'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/tmp/runscript.py", line 137, in <module>
raise e_type(e_value).with_tracsback(new_stack)
AttributeError: 'ModuleNotFoundError' object has no attribute 'with_tracsback'
Run Code Online (Sandbox Code Playgroud)
谁能帮我吗?如果您需要更多信息,请告诉我。
| 归档时间: |
|
| 查看次数: |
13363 次 |
| 最近记录: |