Error in generating a GPG key

Hello. I try to generate a GPG key:

$ gpg2 --gen-key

but have

problem with the agent:No pinentry

Tried that

$ unset DISPLAY

or

~/.gnupg/gpg-agent.conf and add one of the following lines
pinentry-program /usr/bin/pinentry-qt

pinentry, pinentry-qt4 are installed

P.S. Resolved only after I installed pinentry-gtk2

Hm, after reboot I have a problem with it’s usage: GPG: Bad passphrase