powerlineをbash (可能であればzshではない) で使用したいのですが、いくつかのエラーに直面しました。以下は私が行った手順です。
最近、自作を使用してpythonをインストールします
私も実行しましたbrew linkapps python
を使用してpowerline-statsをインストールしましたpip install powerline-status
~/.bash_profileを拡張しました
if [ -f /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh ]; then
source /usr/local/lib/python2.7/site-packages/powerline/bindings/bash/powerline.sh
fi
また、 https://github.com/powerline/fontsからパッチを適用したフォントをインストールしましたinstall.sh
iTerm2で新しいタブを開いた後、このエラーに直面しました。これはpythonに関するものだと思いますが、修正方法がわからないので、助けてください
traceback (most recent call last):
File "/usr/local/bin/powerline-config", line 6, in <module>
from powerline.commands.config import get_argparser
File "/usr/local/lib/python2.7/site-packages/powerline/commands/config.py", line 6, in <module>
import powerline.bindings.config as config
File "/usr/local/lib/python2.7/site-packages/powerline/bindings/config.py", line 19, in <module>
from powerline.commands.main import finish_args
File "/usr/local/lib/python2.7/site-packages/powerline/commands/main.py", line 17, in <module>
encoding = get_preferred_arguments_encoding()
File "/usr/local/lib/python2.7/site-packages/powerline/lib/encoding.py", line 77, in get_preferred_arguments_encoding
locale.getdefaultlocale()[1]
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale
return _parse_localename(localename)
File "/usr/local/Cellar/python/2.7.10_2/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
Traceback (most recent call last):
File "/usr/local/bin/powerline-config", line 6, in <module>
from powerline.commands.config import get_argparser
File "/usr/local/lib/python2.7/site-packages/powerline/commands/config.py", line 6, in <module>
import powerline.bindings.config as config
File "/usr/local/lib/python2.7/site-packages/powerline/bindings/config.py", line 19, in <module>
from powerline.commands.main import finish_args
File "/usr/local/lib/python2.7/site-packages/powerline/commands/main.py", line 17, in <module>
encoding = get_preferred_arguments_encoding()
File "/usr/local/lib/python2.7/site-packages/powerline/lib/encoding.py", line 77, in get_preferred_arguments_encoding
locale.getdefaultlocale()[1]
File "/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/Versions/2.7/lib/python2.7/locale.py", line 543, in getdefaultlocale
return _parse_localename(localename)
File "/usr/local/Cellar/python/2.7.10_2/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
私の環境
python --version
Python 2.7.6
brew list python
/usr/local/Cellar/python/2.7.10_2/bin/2to3
/usr/local/Cellar/python/2.7.10_2/bin/2to3-2
/usr/local/Cellar/python/2.7.10_2/bin/2to3-2.7
/usr/local/Cellar/python/2.7.10_2/bin/easy_install
/usr/local/Cellar/python/2.7.10_2/bin/easy_install-2.7
/usr/local/Cellar/python/2.7.10_2/bin/idle
/usr/local/Cellar/python/2.7.10_2/bin/idle2
/usr/local/Cellar/python/2.7.10_2/bin/idle2.7
/usr/local/Cellar/python/2.7.10_2/bin/pip
/usr/local/Cellar/python/2.7.10_2/bin/pip2
/usr/local/Cellar/python/2.7.10_2/bin/pip2.7
/usr/local/Cellar/python/2.7.10_2/bin/pydoc
/usr/local/Cellar/python/2.7.10_2/bin/pydoc2
/usr/local/Cellar/python/2.7.10_2/bin/pydoc2.7
/usr/local/Cellar/python/2.7.10_2/bin/python
/usr/local/Cellar/python/2.7.10_2/bin/python-config
/usr/local/Cellar/python/2.7.10_2/bin/python2
/usr/local/Cellar/python/2.7.10_2/bin/python2-config
/usr/local/Cellar/python/2.7.10_2/bin/python2.7
/usr/local/Cellar/python/2.7.10_2/bin/python2.7-config
/usr/local/Cellar/python/2.7.10_2/bin/pythonw
/usr/local/Cellar/python/2.7.10_2/bin/pythonw2
/usr/local/Cellar/python/2.7.10_2/bin/pythonw2.7
/usr/local/Cellar/python/2.7.10_2/bin/smtpd.py
/usr/local/Cellar/python/2.7.10_2/bin/smtpd2.7.py
/usr/local/Cellar/python/2.7.10_2/bin/smtpd2.py
/usr/local/Cellar/python/2.7.10_2/bin/wheel
/usr/local/Cellar/python/2.7.10_2/Frameworks/Python.framework/ (3761 files)
/usr/local/Cellar/python/2.7.10_2/IDLE.app/Contents/ (8 files)
/usr/local/Cellar/python/2.7.10_2/lib/pkgconfig/ (3 files)
/usr/local/Cellar/python/2.7.10_2/libexec/pip/ (499 files)
/usr/local/Cellar/python/2.7.10_2/libexec/setuptools/ (227 files)
/usr/local/Cellar/python/2.7.10_2/libexec/wheel/ (92 files)
/usr/local/Cellar/python/2.7.10_2/Python Launcher.app/Contents/ (17 files)
/usr/local/Cellar/python/2.7.10_2/share/man/ (3 files)
/usr/local/Cellar/python/2.7.10_2/share/python/ (315 files)