I just went back to an EC2 instance that has worked in the past, and now it throws this when running letsencrypt-auto:
Traceback (most recent call last):
File "/home/ec2-user/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
from letsencrypt.cli import main
File "/home/ec2-user/.local/share/letsencrypt/local/lib/python2.7/dist-packages/letsencrypt/cli.py", line 17, in <module>
import OpenSSL
File "/home/ec2-user/.local/share/letsencrypt/local/lib64/python2.7/site-packages/OpenSSL/__init__.py", line 8, in <module>
from OpenSSL import rand, crypto, SSL
File "/home/ec2-user/.local/share/letsencrypt/local/lib64/python2.7/site-packages/OpenSSL/rand.py", line 11, in <module>
from OpenSSL._util import (
File "/home/ec2-user/.local/share/letsencrypt/local/lib64/python2.7/site-packages/OpenSSL/_util.py", line 6, in <module>
from cryptography.hazmat.bindings.openssl.binding import Binding
ImportError: No module named cryptography.hazmat.bindings.openssl.binding
File "/home/ec2-user/.local/share/letsencrypt/bin/letsencrypt", line 7, in <module>
from letsencrypt.cli import main
File "/home/ec2-user/.local/share/letsencrypt/local/lib/python2.7/dist-packages/letsencrypt/cli.py", line 17, in <module>
import OpenSSL
ImportError: No module named OpenSSL
pip install -U pip virtualenv did not work for me.
I did use the 5 installs listed above, PLUS in lib64/python2.7 directory I had to remove the empty site-packages directory and softlink it to dist-packages. Once done, all worked.
many thanks! my certbot-auto on amazon linux just randomly stopped working today (weird because i haven’t done any package updates), and your symlink from dist-packages to site-packages fixed it.
now the question is, is this going to happen every time certbot-auto tries to upgrade itself? is there a better way to install/maintain certbot on amazon linux? i use the certbot package from epel on centos6 and centos7, is this known to work on amazon linux?