aws configure 命令不适用于 cli

aws configure command not working on cli

命令 "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"

似乎 aws cli 不能很好地与 python 一起使用 3.

inspect.getargspec(func)

Get the names and default values of a Python function’s arguments. A named tuple ArgSpec(args, varargs, keywords, defaults) is returned. args is a list of the argument names. varargs and keywords are the names of the * and ** arguments or None. defaults is a tuple of default argument values or None if there are no default arguments; if this tuple has n elements, they correspond to the last n elements listed in args.

Deprecated since version 3.0: Use signature() and Signature Object, which provide a better introspecting API for callables. This function will be removed in 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

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

您可能刚刚 python 升级到 3.4.1。

为 Ubuntu 14.04 托管的 AWS CLI 和 botocore 版本与 python 3.4.1+ 不兼容。 (source)

通过 apt-get 安装的 CLI 版本已过期。 Python 3.4.1 引入了我们在 botocore 中使用的 getargspec() 函数的重大更改。 (source)

你可以试试:(我没有testbox来验证)

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

您可以尝试这些步骤

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