awscli入门错误

时间:2013-01-15 07:56:08

标签: python amazon-web-services python-2.7

我已经在1月2日的AWS官方论坛上问了这个,但没有回复。所以,我再次在这里发布它,以便我可以修复错误。


我按照本页http://docs.amazonwebservices.com/cli/latest/userguide/cli-chap-getting-started.html

中的说明安装了awscli

以下是安装细节:

millisami at millisami in ~/Code/face_tester on design ✹
± which python                                                                            
/usr/local/bin/python
millisami at millisami in ~/Code/face_tester on design ✹
± python --version                                                                        
Python 2.7.3
millisami at millisami in ~/Code/face_tester on design ✹
± pip install awscli --upgrade                                                            
Requirement already up-to-date: awscli in /usr/local/lib/python2.7/site-packages
Requirement already up-to-date: botocore>=0.4.0 in /usr/local/lib/python2.7/site-packages/botocore-0.4.1-py2.7.egg (from awscli)
Requirement already up-to-date: six>=1.1.0 in /usr/local/lib/python2.7/site-packages/six-1.2.0-py2.7.egg (from awscli)
Requirement already up-to-date: argparse>=1.1 in /usr/local/lib/python2.7/site-packages/argparse-1.2.1-py2.7.egg (from awscli)
Requirement already up-to-date: requests>=0.12.1,<1.0.0 in /usr/local/lib/python2.7/site-packages/requests-0.14.2-py2.7.egg (from botocore>=0.4.0->awscli)
Requirement already up-to-date: python-dateutil>=2.1 in /usr/local/lib/python2.7/site-packages/python_dateutil-2.1-py2.7.egg (from botocore>=0.4.0->awscli)
Cleaning up...
millisami at millisami in ~/Code/face_tester on design ✹
± aws help                                                                                                                      
Traceback (most recent call last):
  File "/usr/local/share/python/aws", line 15, in <module>
    import awscli.clidriver
  File "/usr/local/lib/python2.7/site-packages/awscli/__init__.py", line 18, in <module>
    import botocore.base
ImportError: No module named botocore.base
millisami at millisami in ~/Code/face_tester on design1 ↵ ✹

由于安装pip成功,但为什么 botocore 报告没有这样的文件?

5 个答案:

答案 0 :(得分:65)

尝试此命令

sudo pip install awscli --force-reinstall --upgrade

答案 1 :(得分:4)

我一直遇到类似boto依赖的同样问题。我基本上在AWS EC2 Ubuntu实例上运行了sudo apt-get install awscli,它完全是开箱即用的。

在刮了几个小时之后,以下似乎已经做了t'trick:

sudo pip install boto --upgrade
sudo pip install boto3 --upgrade
sudo pip install iso8601
sudo pip install sqlalchemy

在运行这些命令后在命令行上键入aws产生了预期的“Usage:...”消息,而不是Python堆栈跟踪。

我希望这对其他人也有帮助!

答案 2 :(得分:1)

brew install awscli

如果您使用的是Mac OS。它在Sierra工作

答案 3 :(得分:0)

我确实遇到了同样的问题但是通过pip / pip3升级awscli并不适用于我。问题的根本原因基本上是两个不同的awscli之间的冲突。通过apt-get install awscli安装后,通过pip3 insstall awscli安装一个。为了解决这个问题,我删除了通过apt-get安装的awscli。这样做会从/ usr / bin / aws中删除aws二进制文件,所以只需从/ usr / loca / bin / aws创建一个软链接。

答案 4 :(得分:0)

安装后不要忘记配置awscli工具:

brew install awscli

pip install awscli

然后

aws configure

我还必须:

pip uninstall boto3
pip install boto3=={correct version}

“ awscli 1.11.166要求botocore == 1.7.24”