我正在亚马逊网络服务的EC2服务器上运行flask应用程序,并且一直在使用boto访问存储在dynamoDB中的数据。在意外地将boto.conf添加到git提交(以及服务器上的推送和拉取)之后,我发现我的python代码不再能够定位boto.conf文件。我使用git回滚了更改,但问题仍然存在。
python模块和boto.conf文件存在于同一目录中,但是当模块调用
boto.config.load_credential_file('boto.conf')我得到了flask error IOError: [Errno 2] No such file or directory: 'boto.conf'。
发布于 2014-03-31 00:30:41
根据Documentation
我真的不确定你为什么要使用boto.config_load_credential_file。通常,您可以在名为~/.boto或/etc/boto.cfg的文件中获取配置。
您还可以查看下面的问题,这也回答了如何获取boto的配置:Getting Credentials File in the boto.cfg for Python
https://stackoverflow.com/questions/22746299
复制相似问题