Python 2.7 Credstash:“模块”对象没有属性“get”:AttributeError

Python 2.7 Credstash:“模块”对象没有属性“get”:AttributeError,python-2.7,aws-lambda,credstash,Python 2.7,Aws Lambda,Credstash,我试图使用credstash访问存储在KMS中的凭据,但是,即使在访问凭据之前,aws上的python 2.7 lambda运行时也给了我一个错误: 'module' object has no attribute 'get': AttributeError Traceback (most recent call last): File "/var/task/lambda_function.py", line 12, in lambda_handler print '%s' %(cr

我试图使用credstash访问存储在KMS中的凭据,但是,即使在访问凭据之前,aws上的python 2.7 lambda运行时也给了我一个错误:

'module' object has no attribute 'get': AttributeError
Traceback (most recent call last):
  File "/var/task/lambda_function.py", line 12, in lambda_handler
    print '%s' %(credstash.get('tv.forecaster.dev.cms.username'))
AttributeError: 'module' object has no attribute 'get'
由于几乎没有任何信息,我徒劳地与这个问题作斗争。如果有人能帮我解决这个问题,我将不胜感激。以下是my requirements.txt:

credstash==1.13.1
cryptography==2.0.3
我正在访问我的凭据,如下所示:

import credstash

string cred = credstash.get('name_of_the_stored_cred_in_dynamodb')

我使用credstash访问凭证的方式是否错误?

我在读取credstash.py的源代码时意识到了错误。基本上,这是一种信任。获取“信任的名字”而不是。获取。此后,它神奇地发挥了作用。另外,我必须将其打包到amazon linux容器中,而不是mac上。

您的项目根目录中是否有一个名为credstash.py的文件,或者您正在上载到lambda的zip文件中?@hansaplast没有,它在zip文件的根目录中。然而,当我阅读credstash.py的源代码时,我意识到了这个错误。基本上,这是一种信任。获取“信任的名字”而不是。获取。此后,它神奇地发挥了作用。另外,我不得不将它打包到AmazonLinux容器而不是mac上。你能把它作为你自己问题的答案吗?