Install & Compatibility
Where this runs
tested against v2.49.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
muslpy 3.10–3.95 runs
installs and imports cleanly · install 0.0s · import 0.000s · 28.4MB
glibcpy 3.10–3.95 runs
installs and imports cleanly · install 2.0s · import 0.000s · 29MB
27MB installed
● package 27MB
Code
Verified usage
Verified import paths — ran on the pinned version, not inferred.
S3Connection
✓ import boto.s3.connection; conn = boto.s3.connection.S3Connection(...)
Typical way to establish a connection to an S3 service endpoint using the Boto 2 API.
This quickstart demonstrates how to connect to Amazon S3 using `boto` and list all available buckets. It highlights the use of environment variables for credentials, a common practice in `boto` and `boto3`.
import boto
import os
# Ensure AWS credentials are set as environment variables (recommended)
# For example: export AWS_ACCESS_KEY_ID='AKIA...'
# export AWS_SECRET_ACCESS_KEY='your_secret_key...'
# Boto 2 primarily supports Python 2, and while it might run on Python 3,
# boto3 is the recommended and actively maintained SDK for Python 3.
try:
# Connect to S3 using credentials from environment variables
# or explicitly provided arguments
conn = boto.connect_s3(
aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', 'YOUR_AWS_ACCESS_KEY_ID'),
aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', 'YOUR_AWS_SECRET_ACCESS_KEY')
)
# List all buckets
print("Listing S3 buckets:")
buckets = conn.get_all_buckets()
if buckets:
for bucket in buckets:
print(f"- {bucket.name}")
else:
print("No S3 buckets found.")
except boto.exception.S3ResponseError as e:
print(f"S3 Error: {e.reason} - {e.error_code} - {e.message}")
print("Please check your AWS credentials and region settings.")
except Exception as e:
print(f"An unexpected error occurred: {e}")
Debug
Known issues
breakingThe `boto` library is officially abandoned and superseded by `boto3`. It is no longer maintained, receives no security updates, and may not be compatible with newer AWS API features or Python versions.fixMigrate your applications to `boto3` (`pip install boto3`). `boto3` offers significantly improved features, active development, robust Python 3 support, and more secure authentication mechanisms.
affects: All versions of `boto` (2.x).
gotcha`boto` was primarily designed for Python 2. While it might run with basic functionality on Python 3 (especially earlier Python 3 versions), it is not officially supported nor tested for Python 3 compatibility. Many functionalities may be broken or behave unexpectedly.fixFor Python 3 development, `boto3` is the actively supported and recommended AWS SDK for Python.
affects: All versions of `boto` when used in Python 3 environments.
gotcha`boto`'s authentication methods are older and less flexible than `boto3`. It often requires explicitly providing `AWS_ACCESS_KEY_ID` and `AWS_SECRET_ACCESS_KEY` directly or via environment variables, and has limited support for modern IAM roles, especially for EC2 instance profiles, compared to `boto3`'s default credential chain.fixEnsure AWS credentials are correctly configured, ideally via environment variables (`AWS_ACCESS_KEY_ID`, `AWS_SECRET_ACCESS_KEY`, `AWS_DEFAULT_REGION`). For improved security and flexibility with IAM roles, consider migrating to `boto3`.
affects: All versions of `boto`.
Upgrade
Version history
2.49.0latest on PyPI · released Jul 11, 2018
Audit
Dependencies
No dependency data recorded yet.