title: AWS: FileNotFoundError: [Errno 2] No such file or directory
body: <p>I am trying to download a file to sagemaker from my S3 bucket.</p>
  
  <p>the path of the file is
  <code>s3://vemyone/input/dicom-images-train/1.2.276.0.7230010.3.1.2.8323329.1000.1517875165.878026/1.2.276.0.7230010.3.1.3.8323329.1000.1517875165.878025/1.2.276.0.7230010.3.1.4.8323329.1000.1517875165.878027.dcm</code></p>
  
  <p>The path of that file is stored as a list element at <code>train_fns[0]</code>.</p>
  
  <p>the value of <code>train_fns[0]</code> is </p>
  
  <p><code>input/dicom-images-train/1.2.276.0.7230010.3.1.2.8323329.1000.1517875165.878026/1.2.276.0.7230010.3.1.3.8323329.1000.1517875165.878025/1.2.276.0.7230010.3.1.4.8323329.1000.1517875165.878027.dcm</code></p>
  
  <p>I used the following code:</p>
  
  <pre><code>s3 = boto3.resource('s3')
  bucketname = 'vemyone'
  
  s3.Bucket(bucketname).download_file(train_fns[0][:], train_fns[0])
  </code></pre>
  
  <p>but I get the following error:</p>
  
  <p><code>FileNotFoundError: [Errno 2] No such file or directory: 'input/dicom-images-train/1.2.276.0.7230010.3.1.2.8323329.1000.1517875165.878026/1.2.276.0.7230010.3.1.3.8323329.1000.1517875165.878025/1.2.276.0.7230010.3.1.4.8323329.1000.1517875165.878027.dcm.5b003ba1'</code></p>
  
  <p>I notice that some characters have appended itself at the end of the path.</p>
  
  <p>how do I solve this problem?</p>