如何解决AWS胶水“ ImportError:无法导入名称'S3ArnParamHandler'”
我在本地开发了pandas etl脚本,并且运行良好。
我准备了一个wheel文件并上传到s3。所有软件包均已正确安装。
但是,脚本运行时会显示ImportError: cannot import name 'S3ArnParamHandler'
以下是我的要求。txt
awscli==1.18.140
asn1crypto==1.4.0
awswrangler==1.9.3
azure-common==1.1.25
azure-core==1.8.1
azure-storage-blob==12.5.0; python_version >= '3.5.2'
boto3==1.14.63
botocore==1.17.63
certifi==2020.6.20
cffi==1.14.2
chardet==3.0.4
cryptography==2.9.2; python_version >= '2.7' and python_version not in '3.0,3.1,3.2,3.3,3.4'
docutils==0.15.2; python_version >= '2.6' and python_version not in '3.0,3.2'
fsspec==0.8.2
idna==2.9; python_version >= '2.7' and python_version not in '3.0,3.3'
isodate==0.6.0
jmespath==0.10.0; python_version >= '2.6' and python_version not in '3.0,3.2'
msrest==0.6.19
numpy==1.19.2
oauthlib==3.1.0; python_version >= '2.7' and python_version not in '3.0,3.3'
oscrypto==1.2.1
packaging==20.4; python_version >= '2.7' and python_version not in '3.0,3.3'
pandas==1.0.0
psycopg2-binary==2.8.6; python_version >= '2.7' and python_version not in '3.0,3.3'
pyarrow==1.0.1; python_version >= '3.5'
pycparser==2.20; python_version >= '2.7' and python_version not in '3.0,3.3'
pycryptodomex==3.9.8; python_version >= '2.6' and python_version not in '3.0,3.3'
pyjwt==1.7.1
pymysql==0.9.0
pyopenssl==19.1.0
pyparsing==2.4.7; python_version >= '2.6' and python_version not in '3.0,3.2'
python-dateutil==2.8.1
pytz==2020.1
requests-oauthlib==1.3.0
requests==2.23.0
s3fs==0.4.2
s3transfer==0.3.3
six==1.15.0
snowflake-connector-python==2.3.2; python_version >= '3.5'
snowflake-sqlalchemy==1.2.3
sqlalchemy-redshift==0.8.1
sqlalchemy==1.3.13
urllib3==1.25.10
xlrd==1.2.0
解决方法
似乎现在无法在AWS Glue Python Shell(https://github.com/boto/boto3/issues/2566)上覆盖botocore和boto3库版本。
提供的版本是:
- botocore 1.12.232
- boto3 1.9.203
aiobotocore正在寻找botocore 1.12.232中不可用的某些导入。
我知道这不是完美的解决方案,但就我而言,我必须删除/降级所有使用那些boto库中不可用功能的依赖项,以使Glue作业正常工作。
,Tomasz 是正确的 - 它与当前(2021 年 4 月)与 Glue 一起使用的 boto3 / botocore 的(较低)版本有关。
如果您尝试使用 read_csv / read_excel 从存储在 S3 中的文件创建 Pandas 数据帧,您将收到此错误。
您可以通过首先将其下载到本地目录,然后将该本地文件名传递给 pandas read_ 函数来绕过它。不漂亮,我知道。
,我刚刚卸载了boto3,然后重新安装
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。