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

Solution: Import the 'StringIO' module

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

from io import StringIO

 

For more information:
Python io StringIO