Skip to content

Instantly share code, notes, and snippets.

@sushidub
Last active February 25, 2019 10:12
Show Gist options
  • Select an option

  • Save sushidub/d1645d7631f642b38e5c3be0fc5f82cd to your computer and use it in GitHub Desktop.

Select an option

Save sushidub/d1645d7631f642b38e5c3be0fc5f82cd to your computer and use it in GitHub Desktop.
AWS EC2 / Certbot / Fix for the Certbot renewal module missing error

Original Issue/Fix

Lately when running certbot renew on my AWS Linux instance produces the following error:

Error: couldn't get currently installed version for /opt/eff.org/certbot/venv/bin/letsencrypt: 
Traceback (most recent call last):
  File "/opt/eff.org/certbot/venv/bin/letsencrypt", line 7, in <module>
    from certbot.main import main
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/certbot/main.py", line 10, in <module>
    import josepy as jose
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/__init__.py", line 44, in <module>
    from josepy.interfaces import JSONDeSerializable
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/interfaces.py", line 8, in <module>
    from josepy import errors, util
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/josepy/util.py", line 4, in <module>
    import OpenSSL
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/__init__.py", line 8, in <module>
    from OpenSSL import crypto, SSL
  File "/opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/OpenSSL/crypto.py", line 12, in <module>
    from cryptography import x509
ImportError: No module named cryptography

FIX Options:

  1. Robust: Follow the original issue fix that @mrballcb posted
  2. Quick:
$ cd /opt/eff.org/certbot/venv/lib64/python2.7
$ rm -rf site-packages
$ ln -s dist-packages/ site-packages
# certbot || certbot renew
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment