How to Solve NameError: name 'open' is not defined -- io

Solution: Import the 'open' module

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

from io import open

 

For more information:
Python io open