Setting up powerline for iTerm2

Some years ago, one of my co-workers pointed me to powerline.
Among other fancy features, it displays your current location in the directory structure. Something like this -
so you do not have to frequently do a pwd to figure out where you are.

This post outlines what you would need to do to set up powerline.

Install pip if you have not, by doing:

sudo easy_install pip

Install powerline by doing:

pip install --user powerline-status

This should set up powerline. For me (OS: High Sierra), the path was $HOME/Library/Python/2.7/lib/python/site-packages/powerline

Then add the following lines to your .bash_profile to source

# Powerline set-up

# The following line is required because 
# `` is unable to find 
# `scripts/powerline-config` without this 
# in the `PATH`.


# Source the script
. $HOME/Library/Python/2.7/lib/python/site-packages/powerline/bindings/bash/

Install fonts by following instructions here. I did this:

git clone
cd fonts

# Install fonts

# Clean up
cd ..
rm -rf fonts

Then go to iTerm2 > Preferences > Profiles > Text and set up powerline fonts for ASCII and non-ASCII fonts like so:


  • My powerline status shows question mark or other special characters instead of arrows. What's wrong?

This happens if you have not selected a powerline font for non-ASCII characters.

  • When I bring up my terminal, I get an error message like this:
-bash: <some long path>/scripts/powerline-config: No such file or directory

This happens if the powerline installation is not in your PATH. Figure out where you installed powerline. In my case it is $HOME/Library/Python/2.7/bin. Including this in the PATH allows the script to be sourced.

More power to your command line!

Chaitra Suresh

Chaitra Suresh

Mom, Engineering Manager, Cook, Musician