I had already installed boto3
but still it gives error of no module named botocore.session
import botocore.session
ImportError: No module named botocore.session
I arrived here from Google. I was getting a similar error while updating AWS Lambda function code. The answer posted here helped in my case. Simply upgrade AWS CLI. Hope this helps someone drifting here from search engines.
pip install awscli --force-reinstall --upgrade
If you got conda environment also. Just use bellow command .
pip install --user awscli --upgrade
This works for me .
I was on version boto3-1.5.33
and botocore-1.8.47
and upgrading to boto3-1.9.75
and botocore-1.12.75
solved the issue for me.
pip install boto3 --upgrade
import boto3
alone is enough to connect with a bucket. botocore.session
was used during for the previous boto 1.8 and is not accepted by boto3. you can refer the following boto3 documents http://boto3.readthedocs.io/en/latest/reference/services/s3.html#client . Here is boto 1.8 documents that mentions the use of botocore.session http://botocore.readthedocs.io/en/latest/tutorial/
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With