donnemartin / saws

A supercharged AWS command line interface (CLI).
Other
5.24k stars 281 forks source link

SAWS bombing on start? Error `ValueError: unknown locale: UTF-8` #43

Closed jjarava closed 8 years ago

jjarava commented 8 years ago

Hi!

Just following the instructions to install and run the tool.

I've just done sudo pip install saws and the install apparently runs fine. The last line of the pip output reads:

Successfully installed awscli-1.8.7 botocore-1.2.5 click-5.1 colorama-0.3.3 configobj-5.0.6 docutils-0.12 enum34-1.0.4 fuzzyfinder-1.0.0 jmespath-0.8.0 ordereddict-1.1 prompt-toolkit-0.50 python-dateutil-2.4.2 rsa-3.2 saws-0.2.1 wcwidth-0.1.5

But when running saws I get:

jjarava$ saws
Traceback (most recent call last):
  File "/usr/local/bin/saws", line 9, in <module>
    load_entry_point('saws==0.2.1', 'console_scripts', 'saws')()
  File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 558, in load_entry_point
    return get_distribution(dist).load_entry_point(group, name)
  File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2682, in load_entry_point
    return ep.load()
  File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2355, in load
    return self.resolve()
  File "/Library/Python/2.7/site-packages/pkg_resources/__init__.py", line 2361, in resolve
    module = __import__(self.module_name, fromlist=['__name__'], level=0)
  File "/Library/Python/2.7/site-packages/saws/main.py", line 20, in <module>
    from .saws import Saws
  File "/Library/Python/2.7/site-packages/saws/saws.py", line 31, in <module>
    from awscli import completer as awscli_completer
  File "/Library/Python/2.7/site-packages/awscli/completer.py", line 12, in <module>
    import awscli.clidriver
  File "/Library/Python/2.7/site-packages/awscli/clidriver.py", line 30, in <module>
    from awscli.help import ProviderHelpCommand
  File "/Library/Python/2.7/site-packages/awscli/help.py", line 19, 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 511, in getdefaultlocale
    return _parse_localename(localename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 443, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

Any clues?

donnemartin commented 8 years ago

@jjarava it seems like you have to add some entries to your ~/.bash_profile. Here are some links that discuss the topic:

http://stackoverflow.com/questions/19961239/pelican-3-3-pelican-quickstart-error-valueerror-unknown-locale-utf-8 https://coderwall.com/p/-k_93g/mac-os-x-valueerror-unknown-locale-utf-8-in-python http://patrick.arminio.info/fix-valueerror-unknown-locale-utf8/ http://sourabhbajaj.com/python/2014/03/31/fix-valueerror-unknown-locale-utf-8/

mlimaloureiro commented 8 years ago

@jjarava also look if you use zsh or somth you should add it to your zshrc

donnemartin commented 8 years ago

@mlimaloureiro thanks for the tip!

@jjarava I'm going to close this ticket it seems the suggestions provided should solve the issues. Please let us know if you still have problems installing.