BotoAWS SDK for Python,可以通过pip安装,也可以下载源码直接安装。直接安装挺方便的。

安装后参照AWS给出的Sample Project,连接S3,遍历一下buckets,获取指定的bucket,都挺简单的。

但是忘记了做一件事,没有“export access keys to environment variables”。模仿Sample只能把access key ID和secret access key作为参数写在代码里。

回过头看文档,再找到Boto Config的文档,然后就傻乎乎地试图去找到文档里提到的"boto.cfg"和".boto",折腾半天没找到。

浪费不少时间之后才明白,boto installer是不会自动创建这个config文件的。手动创建一个,放到该放的地方就可以了。

哪些地方是该放的地方呢?Unix/Linux系统里,boto按照这个顺序寻找config文件。

  • /etc/boto.cfg - for site-wide settings that all users on this machine will use
  • ~/.boto - for user-specific settings
  • ~/.aws/credentials - for credentials shared between SDKs

当然,这也不是必须的,可以把config文件放到任何地方,然后在环境变量里配置BOTO_CONFIG。如果是Windows系统咋办?Stackoverflow上这个问题的回答可行。

  • Create your file with the name you want(e.g boto_config.cfg) and place it in a location of your choice
  • Create an environment variable with the Name='BOTO_CONFIG' and Value= file_location/file_name
  • Boto is now ready to work with credentials automatically configured!

当然,最权威的是仔细看Boto Config文档,这里也介绍了在config文件里如何配置Credentials。

Boto Config File的更多相关文章

  1. [笔记]HAproxy reload config file with uninterrupt session

    HAProxy is a high performance load balancer. It is very light-weight, and free, making it a great op ...

  2. error in config file "/etc/rabbitmq/rabbitmq.config"

    记录一次RabbitMQ配置文件配置错误 error信息: dill@ubuntu-vm:/usr/share/doc/rabbitmq-server$ sudo /usr/lib/rabbitmq/ ...

  3. .NET错误The 'targetFramework' attribute in the <compilation> element of the Web.config file is used only to target version 4.0 and later of the .NET Framework

    错误描述: The 'targetFramework' attribute in the <compilation> element of the Web.config file is u ...

  4. No connection string named '***' could be found in the application config file

    Code-First时更新数据库遇到妖孽问题“No connection string named '***' could be found in the application config fil ...

  5. Camel routes in Spring config file

    The normal spring bean definition configuration file, the xsi:schemaLocation only has two: beans and ...

  6. 为 vsftpd 启动 vsftpd:500 OOPS: bad bool value in config file for: pasv_enable

    每行的值都不要有空格,否则启动时会出现错误,举个例子,假如我在listen=YES后多了个空格,那我启动时就出现.. 为 vsftpd 启动 vsftpd:500 OOPS: bad bool val ...

  7. Warning: World-writable config file '/etc/my.cnf' is ignored

    1. 问题描述: 重启mysql服务时出现以下信息: Warning: World-writable config file '/etc/my.cnf' is ignored 出现这种情况的原因是:m ...

  8. MySQL无法重启问题解决Warning: World-writable config file ‘/etc/my.cnf’ is ignored

    MySQL无法重启问题解决Warning: World-writable config file ‘/etc/my.cnf’ is ignored

  9. Create a custom configSection in web.config or app.config file

    config file: <?xml version="1.0" encoding="utf-8" ?> <configuration> ...

随机推荐

  1. c++拷贝构造函数(深拷贝、浅拷贝)——转

    拷贝构造函数: 拷贝构造函数是一种特殊的构造函数,函数的名称必须和类名称一致,它的唯一的一个参数是本类的一个引用变量,该参数是const类型,不可变的.例如:类A的拷贝构造函数的形式为A(A& ...

  2. php完美匹配邮箱、链接地址和电话号码

    php完美匹配邮箱.链接地址和电话号码 写了好一会有问题,朋友这边很好功能,借用了.嘎嘎 //31日 更新: 匹配手机以及电话号码 重新修改,可支持18开头的手机号,并修改bug,可匹配出字符串中所有 ...

  3. 说说正则表达式的exec方法

    话说,关于正则表达式有一个梗,大意是: 假如你有一个问题,想用正则来解决,于是你就有了两个问题 这句话侧面反映了精通正则是一件不容易的事.比如我今天遇到的诡异事件. 情景回放 这两天练手写了一个爬用户 ...

  4. 滚动条事件window.onscroll

    例:统战滚动条位置随高度变化 // 答题卡位置随滚动条变化 window.onscroll = function(){ var a = document.documentElement.scrollT ...

  5. HTML5本地储存sessionStorage的销毁数据问题

    前几天项目中用到了本地储存,虽然说也就是几个api,但之前有一个问题一直没有去想,我们知道本地储存分为两种,一种是临时储存,关闭浏览器后数据就会销毁,另外一种是没有时间限制的储存,我们做的这个页面比较 ...

  6. xshell 登陆堡垒机实现自动跳转

    1, 正常使用用户密码登录堡垒机并保存登陆配置 2, 配置登陆脚本 添加第一个: expect 为空send :ssh root@ip 添加第二个: expect root@ip's password ...

  7. 22-hadoop-hive搭建

    1, hive简介 hive是基于Hadoop的一个数据仓库工具,可以将结构化的数据文件映射为一张数据库表,并提供简单的sql查询功能,可以将sql语句转换为MapReduce任务进行运行. 其优点是 ...

  8. Visual Studio自带的的Developer Command Prompt对话框

    简单了解Visual Studio的Developer Command Prompt VS2008的命令为:Visual Studio 2008 Command Prompt 目录是: 其详细信息如下 ...

  9. Spring 注解方式引入配置文件

    配置文件,我以两种为例,一种是引入Spring的XML文件,另外一种是.properties的键值对文件: 一.引入Spring XML的注解是@ImportResource @Retention(R ...

  10. JavaScript学习总结(二)——延迟对象、跨域、模板引擎、弹出层、AJAX示例

    一.AJAX示例 AJAX全称为“Asynchronous JavaScript And XML”(异步JavaScript和XML) 是指一种创建交互式网页应用的开发技术.改善用户体验,实现无刷新效 ...