I think this is a language flaw of Python's automatic exception propagation, but we're not here to remove exceptions from Python. Solution: If I understand the problem correctly, you need to properly ...
If you plan to use PyPDF2 for encrypting or decrypting PDFs that use AES, you will need to install some extra dependencies. Encryption using RC4 is supported using the regular installation.