boto连接到Mturk的错误

时间:2012-11-15 09:30:04

标签: python python-2.7 boto mechanicalturk

我正在研究boto版本2.6.0。我有连接到mturk的问题。
我的代码是:

mturk_connection = MTurkConnection(aws_access_key_id=ACCESS_ID, aws_secret_access_key=SECRET_KEY, is_secure = True, host = HOST)
print mturk_connection.get_account_balance()

我得到的错误信息是:

boto.mturk.connection.MTurkRequestError: MTurkRequestError: 200 OK  
<?xml version="1.0"?>
    <GetAccountBalanceResponse>

            <OperationRequest>
            <RequestId>06783745-3810-49d3-8235-d8a95f36b747</RequestId>
            <Errors>
                <Error>
                    <Code>AWS.BadClaimsSupplied</Code>
                    <Message>The specified claims are invalid.   Based on your request, your signature should be generated using the following string: ActionGetAccountBalanceAWSAccessKeyIdAKIAQEQC5M72KQQSignatureVersion1Timestamp2012-11-15T06:10:07ZVersion2012-03-25.  Check to make sure your system clock and timezone is not incorrect.  Our current system time: 2012-11-15T06:10:07Z.  (1352959808079 s)</Message>        
                    <Data>
                            <Key>CustomerSignature</Key>
                            <Value>eMfIjDkM7v2/4fp4WqTOjtaFGDp1/Ydr2TTVV+oP5m0=</Value>
                            </Data><Data>
                            <Key>StringToSign</Key>
                                <Value>ActionGetAccountBalanceAWSAccessKeyIdAKIAJD3HEQEQC5M72KQQSignatureVersion1Timestamp2012-11-15T06:10:07ZVersion2012-03-25</Value>
                            </Data><Data>
                            <Key>SystemTime</Key>
                            <Value>2012-11-15T06:10:07Z</Value>
                    </Data>
            </Error>
        </Errors>
    </OperationRequest>

</GetAccountBalanceResponse>

我尝试找出错误的来源但失败了。请提出建议。

1 个答案:

答案 0 :(得分:1)

我猜你有boto的旧版本,其中错误修复#1057尚未更新。请检查'init'方法的行号525.如果找不到。 。再次从github重新克隆boto存储库,并使用命令

进行安装
python setup.py install

希望你的问题得到解决。