title: Read a JSON from S3
body: <p>I am new to python and following the answers from an <a href="https://stackoverflow.com/questions/40995251/reading-an-json-file-from-s3-using-python-boto3/47121263">existing_post</a> I am trying to read a json file from amazon S3 like this:</p>
  <pre><code>  import boto3
    import os
      BUCKET = 'my_bucket'
      FILE_TO_READ = 'file.json'
      client = boto3.client('s3',
                             aws_access_key_id=os.environ.my_key,
                             aws_secret_access_key=os.environ.my_secret_key
                           )
      result = client.get_object(Bucket=BUCKET, Key='file') 
      text = result[&quot;Body&quot;].read().decode()
      print(text['key']) # Use your desired JSON Key for your value  
  </code></pre>
  <p>However I am receiving the following error:</p>
  <pre><code>NoSuchKey: An error occurred (NoSuchKey) when calling the GetObject operation: The specified key does not exist.
  </code></pre>
  <p>Can someone please tell me what am I doing wrong?</p>