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


title: 使用aws亚马逊的boto3报错解决办法
urlname: 16_python使用aws亚马逊的boto3报错解决办法
author: vsyour
language: zh-CN
date: 2017-05-10 03:03:03
tags: [python]
categories: 网络安全

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

C:\Python27\python.exe D:/python/test_boto3.py
Traceback (most recent call last):
  File "D:/python/test_boto3.py", line 5, in 
    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建.

mkdir \.aws

QQ群:397745473

你可能感兴趣的:(VKSEC,openresty,python,aws,开发语言)