A B C D E F G H I J K L M N O P Q R S T U V W X Y Z
-bash/zsh: cq: command not found # Windows (WSL2) sudo apt-get update sudo apt-get install python-boto # Debian apt-get install python-boto # Ubuntu apt-get install python-boto # Arch Linux pacman -S python2-boto # Kali Linux apt-get install python-boto # CentOS yum install python-boto # Fedora dnf install python2-boto # Raspbian apt-get install python-boto # Python / pip pip install boto3 # Install Boto3 version 1.0 specifically pip install boto3==1.0.0 # Make sure Boto3 is no older than version 1.15.0 pip install boto3>=1.15.0 # Avoid versions of Boto3 newer than version 1.15.3 pip install boto3<=1.15.3 # Dockerfile dockerfile.run/cq
cq / boto/ boto3 (注意,目前最新为 boto3):通过其 REST 和查询 API 支持 30 多种服务,如:
boto 的目标是支持 Amazon Web Services 的全面广度和深度。 此外,除了 Eucalyptus、OpenStack 和 Open Nebula 等私有云系统之外,boto 还提供对 Google Storage 等其他公共服务的支持。
安装 boto3 之后配置,创建 credentials,如:~/.aws/credentials
:
[default] aws_access_key_id = YOUR_KEY aws_secret_access_key = YOUR_SECRET
boto3 设置默认区域,如 ~/.aws/config
:
[default] region=us-east-1
从 Python 解释器运行 boto3:
>>> import boto3 >>> s3 = boto3.resource('s3') >>> for bucket in s3.buckets.all(): print(bucket.name)