I just recently came across an issue when we were bootstrapping one of our EMR clusters, looks like when trying to import pgpy we failed with the following traceback:
Traceback (most recent call last):
File "/mnt/var/lib/hadoop/steps/s-B2LJDDVVD5Y1/./aws_s3_decrypt.py", line 18, in <module>
File "/usr/local/lib/python3.7/site-packages/pgpy/__init__.py", line 4, in <module>
from .pgp import PGPKey
File "/usr/local/lib/python3.7/site-packages/pgpy/pgp.py", line 27, in <module>
from .constants import CompressionAlgorithm
File "/usr/local/lib/python3.7/site-packages/pgpy/constants.py", line 23, in <module>
from ._curves import BrainpoolP256R1, BrainpoolP384R1, BrainpoolP512R1, X25519, Ed25519
File "/usr/local/lib/python3.7/site-packages/pgpy/_curves.py", line 37, in <module>
AttributeError: module 'cryptography.utils' has no attribute 'register_interface'
Command exiting with ret '1'
Apparently the cryptography team released a new version on September 7th 2022 that broke the pgpy library.
We needed to downgrade our version to get things working again. I figured I would post this to see if others run into this, according to the pgpy github page, they are working on a fix.
Here is how I solved it in the meantime, I needed to downgrade the cryptography library.
sudo python3 -m pip install PGPy
sudo python3 -m pip uninstall -y cryptography
sudo python3 -m pip install cryptography==37.0.4
6 thoughts on “AttributeError: module ‘cryptography.utils’ has no attribute ‘register_interface’”
You are a life savor, I thought I broke something on a project
Awesome glad it helped, it sure helped me.
I agree with everything Tahjyei wrote – LIFE SAVER!! Thank you for doing the work and posting it so quickly!
I knew others would hit this issue, so I posted it the same day we ran into it. Glad it helped.
Kudos for this! 🙂
Thanks for your comment. Glad it helped.