命令“aws configure”给出以下错误!这个命令以前工作了!
“aws configure”:
$ aws configure
Traceback (most recent call last):
File "/usr/bin/aws", line 23, in <module>
sys.exit(main())
File "/usr/bin/aws", line 19, in main
return awscli.clidriver.main()
File "/usr/share/awscli/awscli/clidriver.py", line 44, in main
driver = create_clidriver()
File "/usr/share/awscli/awscli/clidriver.py", line 53, in create_clidriver
event_hooks=emitter)
File "/usr/share/awscli/awscli/plugin.py", line 49, in load_plugins
plugin.awscli_initialize(event_hooks)
File "/usr/share/awscli/awscli/handlers.py", line 73, in awscli_initialize
register_removals(event_handlers)
File "/usr/share/awscli/awscli/customizations/removals.py", line 32, in register_removals
'verify-email-address'])
File "/usr/share/awscli/awscli/customizations/removals.py", line 45, in remove
self._create_remover(remove_commands))
File "/usr/lib/python3/dist-packages/botocore/hooks.py", line 64, in register
self._verify_accept_kwargs(handler)
File "/usr/lib/python3/dist-packages/botocore/hooks.py", line 84, in _verify_accept_kwargs
argspec = inspect.getargspec(func)
File "/usr/lib/python3.4/inspect.py", line 936, in getargspec
raise ValueError("Function has keyword-only arguments or annotations"
ValueError: Function has keyword-only arguments or annotations, use getfullargspec() API which can support them
无法理解什么是“ValueError”
答案 0 :(得分:4)
您可能刚刚将python升级到3.4.1。
为Ubuntu 14.04托管的AWS CLI和botocore版本与python 3.4.1+不兼容。 (source)
通过apt-get安装的CLI版本已过期。 Python 3.4.1使用getargspec()函数引入了一个重大变化,我们在botocore中使用它。 (source)
您可以尝试:(我不会让测试盒与我一起验证)
sudo apt-get remove awscli
sudo apt-get install python-pip
sudo pip install awscli
sudo pip install upgrade botocore
答案 1 :(得分:0)
似乎aws cli与python 3不兼容。
inspect.getargspec(FUNC)
获取Python函数参数的名称和默认值。返回一个命名元组ArgSpec(args,varargs,keywords,defaults)。 args是参数名称的列表。 varargs和keywords是*和**参数的名称或None。 defaults是默认参数值的元组,如果没有默认参数,则为None;如果这个元组有n个元素,它们对应于args中列出的最后n个元素。
从3.0版开始不推荐使用:使用signature()和Signature Object,它为callables提供了更好的内省API。这个函数将在Python 3.6中删除。
您可以尝试使用python 2.6或2.7吗?
Requires Python 2.6.5 or higher.
参考:
https://docs.python.org/3/library/inspect.html#inspect.getargspec
答案 2 :(得分:0)
您可以尝试执行以下步骤
sudo pip3 uninstall awscli
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.4 1
sudo pip3 install awscli