Amazon Linux -> ImportError: No module named cryptography.hazmat.bindings.openssl.binding

Hello friends, i have exactly the same problem this guy had:

About 6 months ago i successfully created my cert, on same distro, same instance.
...Amazon Linux

And know im trying to renew, or create a new certified, but i received this error:
ImportError: No module named cryptography.hazmat.bindings.openssl.binding

curl -O https://dl.eff.org/certbot-auto
chmod +x certbot-auto
mv certbot-auto /usr/local/bin/certbot-auto
certbot-auto certonly --standalone -d test.com.br -d www.test.com.br

I did what he did:
pip install cryptography
But i couldn't find which folders should i use this:
ln -s dist-packages site-packages

Can someone help me?

Oi @xinxilas,

In the case of the user from the other thread, it was probably /usr/lib64/python2.7 (although depending on the architecture and operating system configuration, I could imagine that it could instead be /usr/lib32/python2.7 or /usr/lib/python2.7).

I don’t know the details of the packaging issue for which this is supposed to be a solution, I’m just trying to reproduce what the user in the other thread did. :slight_smile:

1 Like

I have these dist-packages:
./opt/eff.org/certbot/venv/lib64/python2.7/dist-packages
./opt/eff.org/certbot/venv/lib/python2.7/site-packages/dist-packages
./opt/eff.org/certbot/venv/lib/python2.7/dist-packages
./usr/lib64/python2.7/dist-packages
./usr/lib/python2.7/dist-packages

And these site-packages
./opt/eff.org/certbot/venv/lib64/python2.7/site-packages
./opt/eff.org/certbot/venv/lib/python2.7/site-packages
./usr/local/lib64/python2.7/site-packages
./usr/local/lib/python2.7/site-packages
./usr/lib64/python2.7/site-packages
./usr/lib/python2.7/site-packages

Solved:

ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cryptography /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cryptography
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cryptography-2.0.2.dist-info /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cryptography-2.0.2.dist-info
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cffi /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cffi
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/cffi-1.10.0.dist-info /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/cffi-1.10.0.dist-info
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/_cffi_backend.so /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/_cffi_backend.so
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/.libs_cffi_backend /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/.libs_cffi_backend
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/zope.interface-4.1.3-py2.7-nspkg.pth /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope.interface-4.1.3-py2.7-nspkg.pth
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/zope.interface-4.1.3-py2.7.egg-info /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope.interface-4.1.3-py2.7.egg-info
ln -s /opt/eff.org/certbot/venv/local/lib64/python2.7/dist-packages/zope/interface /opt/eff.org/certbot/venv/local/lib/python2.7/dist-packages/zope/interface

Also, I did not tried another workaround but it looks it works too:
/opt/eff.org/certbot/venv/local/bin/pip install cryptography interface

2 Likes

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.