繁体   English   中英

尝试使用子流程将特定文件从S3存储桶下载到EC2时,参数类型无效

[英]Invalid argument type when trying to download specific files from S3 bucket to EC2 using subprocess

我正在尝试通过运行以下代码将某些文件从S3下载到本地计算机:

import subprocess, os
ec2_root = '/home/'
s3_root_path = "S3://bucket-name/"
s3_download_command = ["aws", "s3", "cp", os.path.join(s3_root_path, 'my_video.mp4'), os.path.join(local_root)]
p = subprocess.Popen(s3_download_command)
p.communicate()

但是我收到以下错误: usage: aws s3 cp <LocalPath> <S3Uri> or <S3Uri> <LocalPath> or <S3Uri> <S3Uri> Error: Invalid argument type

原来,我使用S3://并使用大写S而不是小写s

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM