0%

使用aws亚马逊的boto3报错解决办法

使用aws亚马逊的boto3报错解决办法
QQ群:397745473

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
C:\Python27\python.exe D:/python/test_boto3.py
Traceback (most recent call last):
  File "D:/python/test_boto3.py", line 5, in <module>
    client = boto3.client('ses')
  File "C:\Python27\lib\site-packages\boto3\__init__.py", line 83, in client
    return _get_default_session().client(*args, **kwargs)
  File "C:\Python27\lib\site-packages\boto3\session.py", line 263, in client
    aws_session_token=aws_session_token, config=config)
  File "C:\Python27\lib\site-packages\botocore\session.py", line 836, in create_client
    client_config=config, api_version=api_version)
  File "C:\Python27\lib\site-packages\botocore\client.py", line 70, in create_client
    verify, credentials, scoped_config, client_config, endpoint_bridge)
  File "C:\Python27\lib\site-packages\botocore\client.py", line 224, in _get_client_args
    verify, credentials, scoped_config, client_config, endpoint_bridge)
  File "C:\Python27\lib\site-packages\botocore\args.py", line 45, in get_client_args
    endpoint_url, is_secure, scoped_config)
  File "C:\Python27\lib\site-packages\botocore\args.py", line 103, in compute_client_args
    service_name, region_name, endpoint_url, is_secure)
  File "C:\Python27\lib\site-packages\botocore\client.py", line 297, in resolve
    service_name, region_name)
  File "C:\Python27\lib\site-packages\botocore\regions.py", line 122, in construct_endpoint
    partition, service_name, region_name)
  File "C:\Python27\lib\site-packages\botocore\regions.py", line 135, in _endpoint_for_partition
    raise NoRegionError()
botocore.exceptions.NoRegionError: You must specify a region.

报上面的错误,原因我是没有配置文件.
按官方文档在
C:\Users\Administrator.aws
建立两个文件就可以了.
credentials
config

注意:.aws必须要有点,windows直接建不出来.可以用cmd建.

1
mkdir \.aws

QQ群:397745473

欢迎关注我的其它发布渠道