sdkbox import googleanalyticsのlocaleエラー

sdkboxを利用してGoogle Analyticsを実装する際に、以下のエラーに恵まれました。

$ sdkbox import googleanalytics
Traceback (most recent call last):
  File "monolith.py", line 2556, in 
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale
    return _parse_localename(localename)
  File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 475, in _parse_localename
    raise ValueError, 'unknown locale: %s' % localename
ValueError: unknown locale: UTF-8

解決方法は~/.bash_profileに以下の2行を追加:
export LANG=en_US.UTF-8
unset LC_CTYPE


そして、以下のを実行して(‘en_US’, ‘UTF-8’)が出れば問題解決のはずです。

source ~/.bash_profile
python
>>> import locale
>>> locale.getdefaultlocale()

最後に、再度sdkbox import googleanalytics実行して

  _______ ______  _     _ ______   _____  _     _
  |______ |     \ |____/  |_____] |     |  \___/ 
  ______| |_____/ |    \_ |_____] |_____| _/   \_
 Copyright (c) 2016 SDKBOX Inc. v1.0.1.22
 test speed of hosts...
 - test host main: 463.11KB/s.
 - test host china: 38.19KB/s.
 choose the fastest server 'main', speed is 463.11KB/s.
 downloading package sdkbox-googleplayservices_v2.3.13.5.tar.gz
[###################################] 100%
 Installation Successful :)
 downloading package sdkbox-googleanalytics_v2.3.13.5.tar.gz
[###################################] 100%
 Please reference the online documentation to finish the integration:
http://sdkbox-doc.github.io/en/plugins/googleanalytics/v3-lua/
 Installation Successful :)

になるかと。

参考

https://github.com/matplotlib/matplotlib/issues/5420/