get_session does not exist #956
Answered
by
WilliamLoey
MariaJessica404
asked this question in
Q&A
-
I have this function but in the console it says get_session does not exist in aiobotocore import aiobotocore
async def upload_fileobj(self, fileobject, bucket, key):
session = aiobotocore.get_session()
async with session.create_client('s3', region_name=self.region,
aws_secret_access_key=self.aws_secret_access_key,
aws_access_key_id=self.aws_access_key_id) as client:
file_upload_response = await client.put_object(ACL="public-read", Bucket=bucket, Key=key, Body=fileobject) |
Beta Was this translation helpful? Give feedback.
Answered by
WilliamLoey
Jul 14, 2022
Replies: 2 comments 1 reply
-
instead of using import aiobotocore
session = aiobotocore.get_session() just import get_session like this from aiobotocore.session import get_session
session = get_session() |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
MariaJessica404
-
this is because I fixed aiobotocore to behave more like botocore so the method has moved location |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
instead of using
just import get_session like this