简体   繁体   English

没有这样的文件或目录 - Boto3

[英]No such file or directory - Boto3

I am running the following with Amazon Sagemaker我正在使用 Amazon Sagemaker 运行以下命令

s3 = boto3.client('s3', region_name='us-east-1', 
                        # Set up AWS credentials 
                        aws_access_key_id=key_id, 
                         aws_secret_access_key=secret_key)


s3.create_bucket(Bucket = 'gid-datacamp')

s3.upload_file(Filename = r'C:\Users\Filippo\Desktop\WineQT.csv' , Bucket = 'gid-datacamp', Key = 'WineQT.csv')

but despite the directory being the correct one I get the following error:但是尽管目录是正确的,但我收到以下错误:

FileNotFoundError: [Errno 2] No such file or directory: 'C:\Users\Filippo\Desktop\WineQT.csv' FileNotFoundError: [Errno 2] 没有这样的文件或目录:'C:\Users\Filippo\Desktop\WineQT.csv'

I also tried to directly import the file using pd.read_csv() and I got the same error.我还尝试使用 pd.read_csv() 直接导入文件,但我遇到了同样的错误。

Is there something I don't know about how boto3 and my local machine interact?关于 boto3 和我的本地机器如何交互,有什么我不知道的吗?

thanks!谢谢!

The python script should run on your local machine , not SageMaker (SM). python 脚本应在您的本地计算机上运行,而不是 SageMaker (SM)。

SM does not have access to your local computer, unless you setup some kind of connection between SM and your home/work computer. SM 无法访问您的本地计算机,除非您在 SM 和您的家庭/工作计算机之间设置某种连接。 Once you have that you can access the files through server (ssh or ftp) running on your local computer.一旦你有了它,你就可以通过在本地计算机上运行的服务器(ssh 或 ftp)访问文件。

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

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