amazon-web-services - Boto3 EndpointConnectionError:无法连接到端点(以前工作正常)
问题描述
我升级到boto3
几个月前。这些操作总是用来正常工作的。据我所知,没有任何改变,但最近当我尝试访问aws
服务器时出现了这个错误。
client = boto3.client(
'mturk',
aws_access_key_id = key,
aws_secret_access_key = secret_key,
endpoint_url= r"https://mturk-requester.us-east-1.amazonaws.com/")
client.get_hit(HITId=hit.id)
botocore.exceptions.EndpointConnectionError: Could not connect to the endpoint URL:
"https://mturk-requester.us-east-1.amazonaws.com/"
现在,在发布命中、检查余额等时会发生这种情况。所有这些操作最初都按预期工作。
我awscli
的配置为
[default]
region=us-east-1
解决方案
对我来说似乎工作得很好:
client = boto3.client('mturk',region_name='us-east-1')
推荐阅读
- c# - C# 数据注释未显示正确的显示名称
- flask - 如何使 WTForms 中的两个 FormField 中的至少一个成为必需的?
- java - 为最后一次出现的字符拆分字符串
- javascript - 如何在 Sequelize 中生成 12 位唯一 ID?
- javascript - 字符串连接 object.values 其中 object.key 等于条件
- java - 在 JTable 中单击鼠标,图像在 JLabel 中不可见
- swift - 有条件地符合 Set 到 ExpressibleByDictionaryLiteral 协议
- python - 在python函数中将值与文本组合
- xml - SerializationFeature.WRITE_DATES_WITH_ZONE_ID 没有给我预期的结果
- python - Edge webdriver 在 SharePoint 网站上找不到对 Firefox 驱动程序可见的元素