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. javascript数据结构与算法---二叉树(删除节点)

    javascript数据结构与算法---二叉树(删除节点) function Node(data,left,right) { this.data = data; this.left = left; t ...

  2. 启动HDFS之后一直处于安全模式org.apache.hadoop.hdfs.server.namenode.SafeModeException: Log not rolled. Name node is in safe mode.

    一.现象 三台机器 crxy99,crxy98,crxy97(crxy99是NameNode+DataNode,crxy98和crxy97是DataNode) 按正常命令启动HDFS之后,HDFS一直 ...

  3. python中@staticmethod与@classmethod

    @ 首先这里介绍一下‘@’的作用,‘@’用作函数的修饰符,是python2.4新增的功能,修饰符必须出现在函数定义前一行,不允许和函数定义在同一行.只可以对模块或者类定义的函数进行修饰,不允许修饰一个 ...

  4. .net core跨平台发布至centos7

    在要发布的项目目录下输入发布命令 dotnet publish -r centos.-x64 发布成功后,文件位于xxx\bin\Debug\netcoreapp2.0\centos.7-x64\pu ...

  5. 这个拖后腿的“in”

    问题之源 C# 7.2推出了全新的参数修饰符in,据说是能提升一定的性能,官方MSDN文档描述是: Add the in modifier to pass an argument by referen ...

  6. 全网最详细的Hadoop HA集群启动后,两个namenode都是active的解决办法(图文详解)

    不多说,直接上干货! 这个问题,跟 全网最详细的Hadoop HA集群启动后,两个namenode都是standby的解决办法(图文详解) 是大同小异. 欢迎大家,加入我的微信公众号:大数据躺过的坑  ...

  7. Intellij IDEA Spring Boot 项目Debug模式启动缓慢问题

    问题 Intellij IDEA Spring Boot 项目Debug模式启动缓慢 环境 os: windows10 idea :2018.1 解决方法 去除所有断点就正常了,很诡异,原因未知.

  8. 探讨e.target与e.currentTarget

    target与currentTarget两者既有区别,也有联系,那么我们就来探讨下他们的区别吧,一个通俗易懂的例子解释一下两者的区别: <!DOCTYPE html> <html&g ...

  9. Java的HashCode,Equal和==

    ----------------------------------------以下是分割线---------------------------------------- 我们都知道Java语言是完 ...

  10. docker部署jenkinsci blueocean

    1.使用docker-compose # cat docker-compose.ymlversion: '2'services: jenkinsci: image: jenkinsci/blueoce ...