Python 3.x 未知服务:';批次';在python3中使用boto3

Python 3.x 未知服务:';批次';在python3中使用boto3,python-3.x,boto3,Python 3.x,Boto3,我在尝试将AWS批处理与boto3一起使用时收到此错误: botocore.exceptions.UnknownServiceError: Unknown service: 'batch'. Valid service names are: acm, apigateway, application-autoscaling, autoscaling, budgets, cloudformation, cloudfront, cloudhsm, cloudsearch, cloudsearchdom

我在尝试将AWS批处理与boto3一起使用时收到此错误:

botocore.exceptions.UnknownServiceError: Unknown service: 'batch'. Valid service names are: acm, apigateway, application-autoscaling, autoscaling, budgets, cloudformation, cloudfront, cloudhsm, cloudsearch, cloudsearchdomain, cloudtrail, cloudwatch, codecommit, codedeploy, codepipeline, cognito-identity, cognito-idp, cognito-sync, config, datapipeline, devicefarm, directconnect, discovery, dms, ds, dynamodb, dynamodbstreams, ec2, ecr, ecs, efs, elasticache, elasticbeanstalk, elastictranscoder, elb, elbv2, emr, es, events, firehose, gamelift, glacier, iam, importexport, inspector, iot, iot-data, kinesis, kinesisanalytics, kms, lambda, logs, machinelearning, marketplacecommerceanalytics, meteringmarketplace, opsworks, rds, redshift, route53, route53domains, s3, sdb, servicecatalog, ses, sms, snowball, sns, sqs, ssm, storagegateway, sts, support, swf, waf, workspaces
误差很容易再现:

user@user-desktop:~$ python3
Python 3.5.2 (default, Nov 23 2017, 16:37:01) 
[GCC 5.4.0 20160609] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import boto3
>>> batch = boto3.client('batch')
检查我的boto3和botocore版本:

>>> boto3.__version__
'1.4.8'
>>> import botocore
>>> botocore.__version__
'1.4.70'

我假设我的系统被错误配置了。有人能猜出我做错了什么吗?

可能是您的botocore没有升级。你得到什么:

import botocore
botocore.__version__
您可以通过以下方式升级botocore:

pip install botocore --upgrade

好主意,尽管我之前尝试过更新botocore,但没有任何效果。我在问题中加入了我的botocore版本。