I was getting following error when running AWS CLI.
MacBook-Pro:python sgoswami$ aws ec2 describe-instances
Traceback (most recent call last):
File "/usr/local/bin/aws", line 15, in <module>
import awscli.clidriver
File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 31, in <module>
from awscli.help import ProviderHelpCommand
File "/Library/Python/2.7/site-packages/awscli/help.py", line 20, in <module>
from docutils.core import publish_string
File "/Library/Python/2.7/site-packages/docutils/core.py", line 20, in <module>
from docutils import frontend, io, utils, readers, writers
File "/Library/Python/2.7/site-packages/docutils/frontend.py", line 41, in <module>
import docutils.utils
File "/Library/Python/2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
import docutils.io
File "/Library/Python/2.7/site-packages/docutils/io.py", line 18, in <module>
from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
File "/Library/Python/2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 496, in getdefaultlocale
return _parse_localename(localename)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 428, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
MacBook-Pro:python sgoswami$ aws ec2 describe-instances
Traceback (most recent call last):
File "/usr/local/bin/aws", line 15, in <module>
import awscli.clidriver
File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 31, in <module>
from awscli.help import ProviderHelpCommand
File "/Library/Python/2.7/site-packages/awscli/help.py", line 20, in <module>
from docutils.core import publish_string
File "/Library/Python/2.7/site-packages/docutils/core.py", line 20, in <module>
from docutils import frontend, io, utils, readers, writers
File "/Library/Python/2.7/site-packages/docutils/frontend.py", line 41, in <module>
import docutils.utils
File "/Library/Python/2.7/site-packages/docutils/utils/__init__.py", line 20, in <module>
import docutils.io
File "/Library/Python/2.7/site-packages/docutils/io.py", line 18, in <module>
from docutils.utils.error_reporting import locale_encoding, ErrorString, ErrorOutput
File "/Library/Python/2.7/site-packages/docutils/utils/error_reporting.py", line 47, in <module>
locale_encoding = locale.getlocale()[1] or locale.getdefaultlocale()[1]
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 496, in getdefaultlocale
return _parse_localename(localename)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 428, in _parse_localename
raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8
All that I did to fix it was:
export LC_ALL=en_US.UTF-8
export LANG=en_US.UTF-8
No comments:
Post a Comment