letsencrypt failed with ImportError: No module named interface

Removing certbot directory did the trick for me.

rm -rf /opt/eff.org/certbot/

wget https://dl.eff.org/certbot-auto
chmod a+x certbot-auto
sudo ./certbot-auto certonly --standalone -d example.com --no-bootstrap

I had same issue and after a long run, a very simple thing solved this issue on my AWS instance:

  1. Move the letsencrypt cache files to another folder (considering you run it as root/sudo):

    sudo mv /root/.local/share/letsencrypt /root/.local/share/letsencrypt-old

  2. Downloaded a brand new version of letsencrypt

    git clone https://github.com/letsencrypt/letsencrypt

  3. Run the letsencrypt command to test if its working again:

    sudo ./letsencrypt-auto --debug

During my search for a solution I also updated pip which might have helped. Although my attempts after pip update did not solved my issue in the same way as cleaning up the letsencnrypt cache folder.

I hope this helps. If not, some links I can share about same issue:

  • certbot zope.interface error
  • no module named interface
  • letsencrypt failed with no module named interface

Part of the issue for me was related to some strange default behavior around 64 bit packages installing, but not being picked up by python. After getting this issue [it's mostly installed at this point], run the following

cd /root/.local/share/letsencrypt
\cp -r ./venv/lib64/* ./venv/lib/

Then retry the command. The install locations of the python virtual environment change with different versions and operating systems, but the general principle has helped me debug two different installs.