How to fix certbot error: unrecognized arguments: –dns-cloudflare-credentials

Problem:

While trying to request a Let’s encrypt certificate using certbot with the DNS-01 challenge using the Cloudflare DNS provider, you see the following error message:

certbot: error: unrecognized arguments: --dns-cloudflare-credentials /etc/letsencrypt/cloudflare-akamba.ini

Solution:

You need to install the cloudflare plugin for certbot using

sudo pip3 install --upgrade certbot-dns-cloudflare

After that, certbot will recognize the --dns-cloudflare-credentials command line option