3

I walked through the following:

http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html https://boto3.readthedocs.io/en/latest/guide/quickstart.html#installation

And came up with the file (pract.py) using an IDE:

import boto3

# Let's use Amazon S3
s3 = boto3.resource('s3')

for bucket in s3.buckets.all():
    print(bucket.name)

And ran it but came across the following error even though I installed the boto3:

ImportError: No module named boto3

How can I confirm everything has been installed and configured correctly? What could be the issue?

Thank you in advance and will be sure to accept/upvote answer

WHEN I DO pip install boto3

enter image description here

Jo Ko
  • 7,225
  • 15
  • 62
  • 120

1 Answers1

2

Did you install via pip? Run the command

pip list

See if the list that is output contains boto3, otherwise, you can follow these instructions:

How to manually install a pypi module without pip/easy_install?

to install boto3 from the zip file downloaded from this link:

https://github.com/boto/boto3

Community
  • 1
  • 1
Preston Martin
  • 2,789
  • 3
  • 26
  • 42
  • Tried it and I see boto3 (1.4.4) yet still getting `ImportError: No module named boto3` – Jo Ko Mar 17 '17 at 21:51
  • if I were you, I would uninstall boto3 via pip (pip uninstall boto3) and then install the package manually from the link provided. You may have setup your paths incorrectly when you installed python/pip. – Preston Martin Mar 18 '17 at 20:33
  • 1
    What I did was sudo apt install python3-pip, then pip3 install boto3. By default, my shell environment launches python 3.5 (aliased via .bashrc). I was able to resolve the no module named boto3, and s3 = boto3.resource('s3') – dat789 Feb 23 '18 at 11:14