How to load a pickle file from S3 to use in AWS Lambda? : <p>I am currently trying to load a pickled file from S3 into AWS lambda and store it to a list (the pickle is a list).</p>

<p>Here is my code:</p>

<pre><code>import pickle
import boto3

s3 = boto3.resource('s3')
with open('oldscreenurls.pkl', 'rb') as data:
    old_list = s3.Bucket("pythonpickles").download_fileobj("oldscreenurls.pkl", data)
</code></pre>

<p>I get the following error even though the file exists:</p>

<pre><code>FileNotFoundError: [Errno 2] No such file or directory: 'oldscreenurls.pkl'
</code></pre>

<p>Any ideas?</p>
