首页 > 解决方案 > aws-glue Python shell 脚本无法连接到 pypi.org

问题描述

我有运行 Python shell 脚本的 AWS-glue 作业。该脚本使用位于 S3 存储桶中的 python 包 mysql_connector_python-8.0.19-cp37-cp37m-manylinux1_x86_64.whl。

该作业抛出一个错误,提示“错误:没有为 protobuf==3.6.1 找到匹配的分布(来自 mysql-connector-python==8.0.19)”。看起来运行脚本的服务器无法与 pypi.org 通信。可以在下面找到有关该错误的更多详细信息。怎么了?


警告:连接被 'ConnectTimeoutError(, '连接到 pypi.org 超时后,重试 (Retry(total=0, connect=None, read=None, redirect=None, status=None))。(连接超时 = 15) ')': /simple/protobuf/


错误:找不到满足 protobuf==3.6.1 要求的版本(来自 mysql-connector-python==8.0.19)(来自版本:无)


Traceback (most recent call last):
  File "/tmp/runscript.py", line 112, in <module>
    download_and_install(args.extra_py_files)
  File "/tmp/runscript.py", line 62, in download_and_install
    subprocess.check_call([sys.executable, "-m", "pip", "install", "--target=
{}
".format(install_path), local_file_path])
  File "/usr/local/lib/python3.6/subprocess.py", line 311, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['/usr/local/bin/python', '-m', 'pip', 'install', '--target=/glue/lib/installation', '/tmp/glue-python-libs-lui8e6qb/mysql_connector_python-8.0.19-cp37-cp37m-manylinux1_x86_64.whl']' returned non-zero exit status 1.

标签: aws-glueamazon-vpc

解决方案


推荐阅读