Azure Databricks - AttributeError pgpy

Divakar Krishnan 106 Reputation points
2022-09-08T07:21:27.783+00:00

Dear Team,

I am using Azure Databricks to encrypt (.gpg) the file from data lake using pgpy library.

It was running fine for last few months and suddenly it's throwing below error message since yesterday.

Error Message:
AttributeError: module 'cryptography.utils' has no attribute 'register_interface'

Python Code:
import pgpy
from pgpy.constants import PubKeyAlgorithm, KeyFlags, HashAlgorithm, SymmetricKeyAlgorithm, CompressionAlgorithm
from timeit import default_timer as timer
import base64
import io

Looks like some issue with pgpy library. Could some one please check and suggest us what to do to ifx?

Thanks,
Divakar

Azure Databricks
Azure Databricks
An Apache Spark-based analytics platform optimized for Azure.
2,068 questions
0 comments No comments
{count} votes

Accepted answer
  1. Emilio Cavarretta 76 Reputation points
    2022-09-08T10:50:46.153+00:00

    Hello,
    I have had the same error.

    On September 7 the cryptography library was updated from version 37.0.4 to version 38.0.1, so the PGPy module is misaligned.

    To fix this:

    1. Remove the PGPy module via pip command
    2. Install the cryptography module to the previous version "pip install cryptography == 37.0.4"
    3. Install the PGPy module again.

    This should temporarily fix the problem, until they update the PGPy library.

    I hope I have been of help to you.

    Best regards


0 additional answers

Sort by: Most helpful