I fixed it by following these instructions by enigmail.net:
Check the contents of
$HOME/.gnupg/gpg-agent.conf
. Make sure that there is a configuration entrypinentry-program
containing the full path to a graphical version ofpinentry
as above. E.g.:pinentry-program /usr/local/bin/pinentry-gtk
Then save the file.
Add the following line to your
$HOME/.gnupg/gpg.conf
file:use-agent
Then save the file and restart your PC.
I am on Ubuntu 14.04.4 LTS.