Here is Step by Step Guide For Installing Powerline on OS X 10.10 (Yosemite) Including Managing the Python Path From Oh My ZSH dot File. Previously, we summarized how to install iTerm2, Homebrew and ZSH on OS X 10.8, for natural reason; some stuffs might give error if you try to install Powerline.
Installing Powerline on OS X 10.10 : Managing Python Installation
OS X by default is shipped with own versions of some UNIX softwares including Python. You should not try to uninstall them. OS X Python is located at for Global usage, Homebrew Python will get install at /usr/local/lib/
. The most important step is to run brew linkapps python
command.
If you have installed Python via Homebrew and forgotten what you did, remove it first. When we will System’s Python, we will use zsh
by typing zsh
at Terminal. We will only add the needed for powerline
part :
---
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | ## needed for powerline starts source /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh export PATH=/usr/local/bin:$PATH # for Python launchctl setenv PATH $PATH ## needed for powerline ends # sample zsh config ZSH=$HOME/.oh-my-zsh # zsh theme ZSH_THEME="robbyrussell" export UPDATE_ZSH_DAYS=10 COMPLETION_WAITING_DOTS="true" # zsh plugin plugins=(git colored-man colorize github jira vagrant virtualenv pip python brew osx zsh-syntax-highlighting cake git-flow git-extras npm node theme web-search battery) source $ZSH/oh-my-zsh.sh # go export CC=clang GOPATH=/usr/local/bin/go GOROOT=/usr/local/bin source /Users/abhishekghosh/.iterm2_shell_integration.zsh # Ruby export PATH="$PATH:$HOME/.rvm/bin" |
Add the lines missing to .zshrc
, but do not source it.
First and foremost important points are to rightly fix Homebrew and update, set Python path rightly and then install Python, update Pip etc. via Homebrew :
1 | brew install python |
If you face problem in the next steps, that is usually due to error in the above setup. It is really painful to fix, last option is re-installing Homebrew when Python gets fully abnormal – which python
is returning /usr/local/bin/python
but running pip install
is installing stuffs on System Python’s path. Do not try to remove the System’s OS X related Python. Do whatever with Homebrew.
We hope that you have updated Xcode command line tools.
Steps For Installing Powerline on OS X 10.10
Next need is to install a set of patched Font :
1 | https://github.com/Lokaltog/powerline-fonts # copy url in text editor first |
Very easy. From iTerm’s iTerm > Preferences… menu, change the Font to any patched Font. Next, you need to do these :
1 2 | brew install vim --with-python --with-ruby --with-perl brew install macvim --env-std --override-system-vim |
If you work in this way, in future it is unlikely that you will ever call us bad names after learning vi, in case you are not mastered vim yet. We have no .vimrc
file. We need no such.
Next is Powerline :
1 2 3 | pip install powerline-status ## below is dev version # pip install --user git+git://github.com/powerline/powerline |
More Powerline specific guide is here :
1 | http://powerline.readthedocs.org/en/latest/installation.html # copy url in text editor first |
First do a cat :
1 | cat /usr/local/lib/python2.7/site-packages/powerline/bindings/zsh/powerline.zsh |
If it returns something then source .zshrc
:
1 | source .zshrc |
We added the needed lines on .zshrc
before. If you dislike Powerline or want to “pause” usage, then uncomment the source /usr/local/lib/python...zsh/powerline.zsh
line and source the .zshrc
.
The text editor shown in screenshot is using our nano syntax highlighting repo. Whether you’ll use tmux or vi; this is not possible to predict. This is the basic setup.