以下是说明: http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-set-up.html 这是什么是颂歌
an$ aws configuration
Traceback (most recent call last):
File "/usr/local/bin/aws", line 15, in <module>
import awscli.clidriver
File "/usr/local/aws/lib/python2.7/site-packages/awscli/clidriver.py", line 31, in <module>
from awscli.help import ProviderHelpCommand
File "/usr/local/aws/lib/python2.7/site-packages/awscli/help.py", line 20, in <module>
from docutils.core import publish_string
File "/usr/local/aws/lib/python2.7/site-packages/docutils/core.py", line 20, in <module>
from docutils import frontend, io, utils, readers, writers
File "/usr/local/aws/lib/python2.7/site-packages/docutils/frontend.py", line 41, in <module>
import docutils.utils
File "/usr/local/aws/lib/python2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
import docutils.io
File "/usr/local/aws/lib/python2.7/site-packages/docutils/io.py", line 18, in <module>
from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
File "/usr/local/aws/lib/python2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
File "/usr/local/aws/lib/python2.7/locale.py", line 511, in getdefaultlocale
return _parse_localename(localename)
File "/usr/local/aws/lib/python2.7/locale.py", line 443, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
任何想法_?
答案 0 :(得分:66)
尝试将以下行添加到~/.bash_profile
:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
答案 1 :(得分:3)
在Windows机器上安装AWSCLI
我在Windows 10(64位)上遇到了类似的问题。我的电脑上安装了Python 3.5和Python 2.7。我得到ImportError: No module named awscli.clidriver
。
然后我在环境路径变量中添加了%USERPROFILE%\AppData\Roaming\Python\Python35\Scripts
,并从环境路径变量中删除了Python 2.7。现在我可以成功使用awscli
。
我已在此Github存储库中创建了一步一步的AWSCLI安装指南:https://github.com/arsho/installation/tree/master/awscli_installation。
答案 2 :(得分:1)
在我的情况下没有任何效果,直到我给予更多权限,我使用非root用户运行aws命令
chown amzadm.root /usr/bin/aws
chown amzadm.root -R /usr/lib/python2.6/site-packages/
chown amzadm.root -R /usr/lib/python2.6/site-packages/awscli/
答案 3 :(得分:0)
我通过在导入之前向'aws'脚本添加一行来修复此问题(第19行)。所以现在文件显示:
sys.path.append('/Users/<username>/.local/lib/aws/lib/python2.7/site-packages/')
import awscli.clidriver
答案 4 :(得分:0)
这项工作对我而言。在/.barshrc文件中
export AWS_DEFAULT_OUTPUT="json"
答案 5 :(得分:0)
我必须安装EKS支持的版本,但最终却可以忽略six
来使用它:
$ pip3 install awscli --ignore-installed six