python - 想要连接到 dynamoDB,得到 AttributeError : 'module' object has no attribute 'connect_to_region'

标签 python module connect amazon-dynamodb attributeerror

这是我的简单代码:

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==2.2.2 版本的 boto.dynamodb 中没有 connect_to_region() 函数。

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

pip install boto --upgrade

关于python - 想要连接到 dynamoDB,得到 AttributeError : 'module' object has no attribute 'connect_to_region' ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22718987/

相关文章:

iphone - 将 NSString 转换为日期错误

带有事件的 Python TAPI COM 对象

Python - 如何使用模块的别名导入其子模块?

c++ qt QObject::connect: 没有这样的插槽

c# - 如何连接到 Visual Studio 中的数据库

python - 使用 'requests-html'时如何使用绝对链接路径获取原始html

python - 如何在 Django 模板中使用 href 属性

python - python 3.6.4 中的错误 Opencv 3

Drupal CDN 模块和 Fileconveyor 守护进程与 Amazon S3 服务器一起用于内容交付

我的 express 应用程序中的 mongoose.connect 名称为 : MongoParserError , 消息: 'URI malformed, cannot be parsed'