简体   繁体   English

适用于 S3 的 AWS CLI - Errno 2 没有这样的文件或目录:u'

[英]AWS CLI for S3 - Errno 2 No such file or directory: u'

I'm trying to extract a few hundred GB of data from an S3 bucket to a Windows 10 computer's external hard drive and the command I'm using (in a .bat file with AWSCLI-64bit installed) is:我正在尝试从 S3 存储桶中将几百 GB 的数据提取到 Windows 10 计算机的外部硬盘驱动器,我使用的命令(在安装了 AWSCLI-64bit 的 .bat 文件中)是:

aws s3 sync s3://aws-extraction/ F:\Bowral-PE\ --delete --region ap-southeast-2 > "%SyncLogFile%"

For the most part it seems to be working because files seem to be downloading and directories seem to be getting created.在大多数情况下,它似乎正在工作,因为文件似乎正在下载并且目录似乎正在创建。 So far there's 82GB of data downloaded, but every single line says in the cmd verbose output shows:到目前为止,已经下载了 82GB 的数据,但是 cmd 详细输出中的每一行都显示:

download failed: s3://aws-extraction/Archive/somedirectory/ to F:\\Bowral-PE\\Archive\\somedirectory Errno 2 No such file or directory: u'F:\\Bowral-PE\\Archive\\somedirectory '下载失败:s3://aws-extraction/Archive/somedirectory/ 到 F:\\Bowral-PE\\Archive\\somedirectory Errno 2 No such file or directory: u'F:\\Bowral-PE\\Archive\\somedirectory '

Any ideas why I'm getting this and how to stop it?任何想法为什么我会得到这个以及如何阻止它?

Please note that the AWSCLI seems to be using Python or something similar (a guess based on results when searching for the error), and I am a complete newbie when it comes to Python.请注意,AWSCLI 似乎正在使用 Python 或类似的东西(根据搜索错误时的结果进行猜测),而我是 Python 的完全新手。

I hit the similar problem when using the msi version of latest awscli on my windows 10 today: 我今天在Windows 10上使用最新的awscli的msi版本时遇到了类似的问题:

C:>aws s3 sync s3://<my_bucket_name>/ <local_dir>
   fatal error [Errno 2] No such file or directory

The above sync command works if I backup the bucket content to a unix machine. 如果将存储桶内容备份到UNIX计算机,则上述同步命令将起作用。

After some googling, seems the "fatal error [Errno 2] No such file or directory" is coming out from python. 经过一番谷歌搜索后,似乎“严重错误[Errno 2]没有这样的文件或目录”从python中发出。

I realised the awscli's windows msi version uses the self contained python (v2.7), which may be too old for windows 10. 我意识到awscli的Windows MSI版本使用自包含的python(v2.7),对于Windows 10来说可能太旧了。

I then installed the latest python (v3.6), used pip way to install awscli following the instructions here . 然后,我按照此处的说明安装了最新的python(v3.6),使用pip方式安装awscli。

After this the direct backup / restoration works as expected. 此后,直接备份/还原将按预期工作。

For me, I was getting this notification at the same time:对我来说,我同时收到了这个通知:

在此处输入图片说明

By clicking on it and allowing Python to access the folder I was trying to save it in, I was able to rerun the command and it succeeded.通过单击它并允许 Python 访问我试图保存它的文件夹,我能够重新运行该命令并且它成功了。

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

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