简体   繁体   English

未知服务:在python3中使用boto3进行“批处理”

[英]Unknown service: 'batch' using boto3 in python3

I'm receiving this error trying to use AWS Batch with boto3: 我在尝试将AWS Batch与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

The error is easily reproducible: 该错误很容易重现:

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')

Checking my boto3 and botocore versions: 检查我的boto3和botocore版本:

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

I'm assuming my system is somehow misconfigured. 我假设我的系统配置错误。 Can anyone guess what I may be doing wrong? 谁能猜出我可能做错了什么?

It is possible your botocore didn't get upgraded. 您的botocore可能没有升级。 What do you get for: 你得到什么:

import botocore
botocore.__version__

You can upgrade botocore by: 您可以通过以下方式升级botocore:

pip install botocore --upgrade

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM