How to Solve NameError: name 'PKCS1_OAEP' is not defined -- Crypto

Solution: Import the 'PKCS1_OAEP' module

To Solve the error, add the following line to the top of your code.

from Crypto.Cipher import PKCS1_OAEP

 

For more information:
Python Crypto PKCS1_OAEP