未知服务:在python3中使用boto3'批处理'

问题描述 投票:0回答:1

我在尝试将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

该错误很容易重现:

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'

我假设我的系统在某种程度上错误配置。谁能猜到我可能做错了什么?

python-3.x boto3
1个回答
1
投票

您的botocore可能无法升级。你得到了什么:

import botocore
botocore.__version__

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

pip install botocore --upgrade
© www.soinside.com 2019 - 2024. All rights reserved.