简体   繁体   English

aws configure命令在cli上不起作用

[英]aws configure command not working on cli

Command "aws configure" giving following error ! 命令“ aws configure”给出以下错误! This command was working before ! 这个命令以前工作过!

"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

Can't understand what is the "ValueError" 无法理解什么是“ ValueError”

You probably have just upgraded python to 3.4.1. 您可能刚刚将python升级到了3.4.1。

The version of the AWS CLI and botocore hosted for Ubuntu 14.04 is incompatible with python 3.4.1+. 为Ubuntu 14.04托管的AWS CLI和botocore版本与python 3.4.1+不兼容。 ( source ) 来源

The version of the CLI installed via apt-get is out of date. 通过apt-get安装的CLI版本已过期。 Python 3.4.1 introduced a breaking change with the getargspec() function, which we use in botocore. Python 3.4.1引入了getargspec()函数的重大更改,我们在botocore中使用了该函数。 ( source ) 来源

You can try: (I don't have testbox with me to verify) 您可以尝试:(我没有测试箱可以验证)

sudo apt-get remove awscli
sudo apt-get install python-pip
sudo pip install awscli
sudo pip install upgrade botocore

Seems aws cli doesn't work well with python 3. 似乎aws cli在python 3中无法正常工作。

inspect.getargspec(func) inspect.getargspec(功能)

Get the names and default values of a Python function's arguments. 获取Python函数参数的名称和默认值。 A named tuple ArgSpec(args, varargs, keywords, defaults) is returned. 返回一个命名的元组ArgSpec(args,varargs,关键字,默认值)。 args is a list of the argument names. args是参数名称的列表。 varargs and keywords are the names of the * and ** arguments or None. varargs和关键字是*和**参数的名称或无。 defaults is a tuple of default argument values or None if there are no default arguments; defaults是默认参数值的元组;如果没有默认参数,则为None; if this tuple has n elements, they correspond to the last n elements listed in args. 如果该元组具有n个元素,则它们对应于args中列出的最后n个元素。

Deprecated since version 3.0: Use signature() and Signature Object, which provide a better introspecting API for callables. 从3.0版开始不推荐使用:使用signature()和Signature Object,它们为可调用对象提供了更好的自省API。 This function will be removed in Python 3.6. 此功能将在Python 3.6中删除。

Can you try with python 2.6 or 2.7? 您可以尝试使用python 2.6或2.7吗?

Requires Python 2.6.5 or higher.

Refer: 参考:

https://docs.python.org/3/library/inspect.html#inspect.getargspec https://docs.python.org/3/library/inspect.html#inspect.getargspec

https://aws.amazon.com/cli/ https://aws.amazon.com/cli/

You can try with these steps 您可以尝试执行以下步骤

sudo pip3 uninstall awscli
sudo update-alternatives --install /usr/bin/python python /usr/bin/python3.4 1
sudo pip3 install awscli

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

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