In [2]:
from s3monkey import S3FS
import pandas as pd
In [6]:
with S3FS(bucket='notebooks-data', mount_point='/') as fs:
with open('/All_Starbucks_Locations_in_the_World.csv', 'r') as fobj:
df = pd.read_csv(fobj)
df.tail()
---------------------------------------------------------------------------
ClientError Traceback (most recent call last)
<ipython-input-6-3e73b1269113> in <module>()
----> 1 with S3FS(bucket='notebooks-data', mount_point='/') as fs:
2 with open('/All_Starbucks_Locations_in_the_World.csv', 'r') as fobj:
3 df = pd.read_csv(fobj)
4
5 df.tail()
/usr/local/lib/python3.6/site-packages/s3monkey/core.py in __init__(self, bucket, mount_point, other_dirs, **kwargs)
96 super(S3FS, self).__init__()
97 self.bucket_name = bucket
---> 98 self.bucket = bucketstore.get(self.bucket_name, **kwargs)
99 self.mount_point = mount_point
100 self.patcher = S3Patcher(filesystem=self)
/usr/local/lib/python3.6/site-packages/bucketstore.py in get(bucket_name, create)
11
12 def get(bucket_name, create=False):
---> 13 return S3Bucket(bucket_name, create=create)
14
15
/usr/local/lib/python3.6/site-packages/bucketstore.py in __init__(self, name, create)
30
31 # Check if the bucket exists.
---> 32 if not self._boto_s3.Bucket(self.name) in self._boto_s3.buckets.all():
33 if create:
34 # Create the bucket.
/usr/local/lib/python3.6/site-packages/boto3/resources/collection.py in __iter__(self)
81
82 count = 0
---> 83 for page in self.pages():
84 for item in page:
85 yield item
/usr/local/lib/python3.6/site-packages/boto3/resources/collection.py in pages(self)
159 self._parent.meta.service_name,
160 self._py_operation_name, params)
--> 161 pages = [getattr(client, self._py_operation_name)(**params)]
162
163 # Now that we have a page iterator or single page of results
/usr/local/lib/python3.6/site-packages/botocore/client.py in _api_call(self, *args, **kwargs)
315 "%s() only accepts keyword arguments." % py_operation_name)
316 # The "self" in this scope is referring to the BaseClient.
--> 317 return self._make_api_call(operation_name, kwargs)
318
319 _api_call.__name__ = str(py_operation_name)
/usr/local/lib/python3.6/site-packages/botocore/client.py in _make_api_call(self, operation_name, api_params)
613 error_code = parsed_response.get("Error", {}).get("Code")
614 error_class = self.exceptions.from_code(error_code)
--> 615 raise error_class(parsed_response, operation_name)
616 else:
617 return parsed_response
ClientError: An error occurred (InvalidAccessKeyId) when calling the ListBuckets operation: The AWS Access Key Id you provided does not exist in our records.
In [ ]:
Content source: myles/notebooks
Similar notebooks: