python - 无法连接到端点 aws
问题描述
尝试使用 Amazon Comprehend 时出现错误: botocore.exceptions.EndpointConnectionError:无法连接到终端节点 URL:“ https://comprehend.region.amazonaws.com/ ”
我尝试在谷歌上搜索解决方案,但stuckoverflow 没有找到适合我的解决方案..
尝试将默认区域名称设置为 [us-east-1] ,我发现为其他人工作的更多内容对我不起作用
comprehend = boto3.client(service_name='comprehend', region_name='region')
json.dumps(comprehend.detect_dominant_language(Text=t), sort_keys=True, indent=4)
解决方案
区域名称必须是 AWS 的区域代码名称之一,例如“us-east-1”代表北弗吉尼亚州,“eu-west-1”代表爱尔兰等...
地区列表可在此处获得
https://docs.aws.amazon.com/general/latest/gr/rande.html
所以你的代码应该是
comprehend = boto3.client(service_name='comprehend', region_name='us-east-1')
json.dumps(comprehend.detect_dominant_language(Text=t), sort_keys=True, indent=4)
推荐阅读
- javascript - 如何在 React Shadow Root 中应用样式?
- amazon-web-services - Gatsby 站点在 EC2 上使用 pm2 节点和 aws 经典负载均衡器服务需要 https
- emacs - 如何自动在所有 clojure、closurescript 和 elisp 缓冲区上自动启用 paredit 模式?
- reactjs - React 组件无限重新渲染,在 useEffect 挂钩中设置相同的布尔值状态?
- java - 占位符 Spring Boot 中的映射
- spring - Spring Boot中的InternalViewResolver无法找到视图
- vue.js - Vuetify 数据表中的行数稳定不变
- c# - 从 MainWindow.xaml.cs 类,为什么我无法访问 App.xam.cs 类的自定义属性
- c# - Authentication.AzureADB2C.UI - 如何自定义错误页面 - .Net Core 3.1
- javascript - 如何将过滤器值作为状态的一部分向上传递并将其作为道具返回,从而过滤掉某些项目?