Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ImportError: No module named botocore.session

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
like image 938
Vidip Avatar asked Jan 22 '18 08:01

Vidip


4 Answers

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
like image 171
Tirtha R Avatar answered Nov 12 '22 17:11

Tirtha R


If you got conda environment also. Just use bellow command .

pip install --user awscli --upgrade

This works for me .

like image 41
Asraful Avatar answered Sep 19 '22 08:09

Asraful


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
like image 7
ryanjdillon Avatar answered Nov 12 '22 17:11

ryanjdillon


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/

like image 6
vishal Avatar answered Nov 12 '22 16:11

vishal