【发布时间】:2019-06-17 21:19:05
【问题描述】:
我尝试从 AWS S3 存储运行 python 文件,例如
python s3://test-bucket/test/py_s3_test.py
我收到错误:
python: can't open file 's3://test-bucket/test/py_s3_test.py': [Errno 2] No such file or directory
是否有运行 python 文件驻留在 AWS S3 中。
谢谢。
【问题讨论】:
-
您需要先从 S3 下载它。如果您可以使用 S3 的
http接口,您可以执行类似curl https://s3_url/ | python的操作。 -
正如@jordanm 指出的那样,您不能直接使用 python 流式传输 s3 文件。在他的回答之上,你还可以尝试 aws-cli 进行此类操作!
标签: python amazon-s3 amazon-ec2