This package seems to have become unmaintained, but I have worked a solution to the problem with minor corrections.

line 22 should read:
self._ps1dict={"\u":os.environ['USER'],'@':'@',"\h":gethostname().split('.')[0],"\W":" "+os.getcwd().split('/')[-1],"\w":" "+os.getcwd(),"\d":time.strftime(' %a %b %d'),"\$":" $" }

To make this work, this line needs to be added to the imports. If adding this first, the line above becomes line 23.
from socket import gethostname