Why is GPG not working even with pinentry installed?

gnupg, macos

Solution

I've had that error message when trying to decrypt a (symmetrically encrypted) file on OS X (macOS Sierra 10.12.4). Solution was to add the option `--pinentry-mode loopback`

bla$ gpg -d ciphertext.gpg 
gpg: AES encrypted data
gpg: problem with the agent: No pinentry
gpg: encrypted with 1 passphrase
gpg: decryption failed: No secret key

bla$  gpg --pinentry-mode loopback -d ciphertext.gpg 
gpg: AES encrypted data
Enter passphrase: ...
gpg: encrypted with 1 passphrase
...plaintext...

Problem

Despite me installing pinentry, I still get the following error: ``` xxxxxxxMacxxxxx:~ MAU$ gpg2 -c --cipher-algo=aes gpg-agent[89931]: can't connect to the PIN entry module: IPC connect call failed gpg-agent[89931]: command get_passphrase failed: No pinentry gpg: problem with the agent: No pinentry gpg: error creating passphrase: Operation cancelled gpg: symmetric encryption of `[stdin]' failed: Operation cancelled ```

Original source