【问题标题】:want to connect to dynamoDB, get AttributeError: 'module' object has no attribute 'connect_to_region'想要连接到 dynamoDB,得到 AttributeError: 'module' object has no attribute 'connect_to_region'
【发布时间】:2014-05-08 06:40:42
【问题描述】:

这是我的简单代码:

import boto.dynamodb
conn = boto.dynamodb.connect_to_region(
   'us-east-1',
   aws_access_key_id='....',
   aws_secret_access_key='....')
print conn

我得到:

Traceback (most recent call last):
  File "startMarch28.py", line 5, in <module>
    conn = boto.dynamodb.connect_to_region(
AttributeError: 'module' object has no attribute 'connect_to_region'

【问题讨论】:

  • 您使用的是哪个boto 版本? (boto.__version__)
  • 感谢您的回复。它是:2.2.2

标签: python module connect amazon-dynamodb attributeerror


【解决方案1】:

boto==2.2.2版本的boto.dynamodb中没有connect_to_region()函数。

将模块升级到最新的 (2.27.0) 版本:

pip install boto --upgrade

【讨论】:

  • 我试过了,得到了一个 Trraceback 列表和 OSError: [Errno 13] Permission denied: '/usr/share/pyshared/boto-2.2.2.egg-info'
  • @user3473556 如果它是您的系统 python - 使用 sudo 运行命令。
  • 做到了。非常感谢!!
猜你喜欢
  • 2015-09-26
  • 2014-12-20
  • 1970-01-01
  • 1970-01-01
  • 2022-12-01
  • 2022-12-01
  • 2017-10-26
相关资源
最近更新 更多