Python botocore.exceptions.NoRegionError:必须指定一个区域

Python botocore.exceptions.NoRegionError:必须指定一个区域,python,amazon-web-services,jenkins,jenkins-pipeline,boto3,Python,Amazon Web Services,Jenkins,Jenkins Pipeline,Boto3,我已经在[~/.AWS/config]中配置了我的AWS区域,但是这个问题一再出现。 我如何解决这个问题 botocore.exceptions.NoRegionError: You must specify a region. During handling of the above exception, another exception occurred: -------------------------------------------------------------------

我已经在
[~/.AWS/config]
中配置了我的AWS区域,但是这个问题一再出现。
我如何解决这个问题

botocore.exceptions.NoRegionError: You must specify a region.
During handling of the above exception, another exception occurred:
-----------------------------------------------------------------------------

我的是
ap-south-1
。您的API可能不同。

您通过什么API调用收到此消息?在创建
boto3.client('service-name',region\u name='us-east-1')
时,您是否尝试指定
区域名称
,以查看这是否会删除异常?@JohnRotenstein这修复了我的错误,即使此解决方案不在。你能写一个答案吗?“sudo aws configure”与“aws configure”不同,它帮助我解决了这个错误——但我相当肯定我在某个地方把安装搞砸了。
$aws configure

AWS Access Key ID [****************LT6U]:
AWS Secret Access Key [****************iGrm]:
Default region name [ap-south-1]:
Default output format [json]:

specify: Default region name [ap-south-1]: