简体   繁体   English

获取“ ImportError:无法导入名称check_output”(EB CLI上的git aws.push)

[英]Getting “ImportError: cannot import name check_output” (git aws.push on EB CLI)

I've installed and configurated AWS Elastic Beanstalk Command Line Tool on my Mac. 我已经在Mac上安装并配置了AWS Elastic Beanstalk命令行工具

That's what I have installed: 那就是我安装的:

$ python --version
Python 2.7
$ ruby --version
ruby 2.0.0p195 (2013-05-14 revision 40734) [x86_64-darwin10.8.0]
$ eb --version
AWS Elastic Beanstalk Command Line Interface v2.6.3

I have EB properly configured in order to use git with AWS 我已正确配置EB以便将git与AWS结合使用

When I try to push a commit to AWS I am getting this error: 当我尝试将提交推送到AWS时,出现此错误:

$ git aws.push
Traceback (most recent call last):
  File ".git/AWSDevTools/aws.elasticbeanstalk.push", line 21, in <module>
    from aws.dev_tools import * 
  File "/Applications/MAMP/htdocs/innbativel/.git/AWSDevTools/aws/dev_tools.py", line 3, in <module>
    from subprocess import check_output
ImportError: cannot import name check_output

Does anyone have an idea why and how to fix it? 有谁知道为什么以及如何解决它?

I found that my OSX comes with python 2.6 (which doesn't have check_output ) and it was conflicting with python 2.7 that I've installed for EB CLI. 我发现我的OSX带有python 2.6(没有check_output ),并且与我为EB CLI安装的python 2.7冲突。

To solve this, I just made .git/AWSDevTools/aws.elasticbeanstalk.push use python 2.7, in its first line: 为了解决这个问题,我只是在第一行.git/AWSDevTools/aws.elasticbeanstalk.push使用python 2.7:

#!/usr/bin/env python2.7

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

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