0

I keep getting this error:

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

when ever I run the command:

./letsencrypt-auto certonly --standalone --email <email> -d <domain> -d <sub-domain>

Every guide I follow, I run into this error. I don't know how to get away from this error. I've even tried rm -rf eff.org. I still can't get it working.

I am using Amazon EC2 Linux 1 (Red Hat).

Nov
  • 99
  • 1
  • 11
  • This related question/solution might also be useful for others in a similar situation: https://stackoverflow.com/questions/57891591/how-to-fix-importerror-no-module-named-cryptography – Wireblue Dec 20 '20 at 22:45

1 Answers1

1

I experienced a similar issue and fixed by installing certbot via pip.

Remove /opt/eff.org/*

Then pip install -U certbot

and certbot commands will work fine.

Pubudu Jayawardana
  • 2,250
  • 1
  • 13
  • 18
  • I built a certificate before on the same EC2. Because of that, it seems there are some default options that keep getting loaded whenever I use certbot to upload a new certificate. – Nov Feb 28 '19 at 23:12