How to Solve NameError: name 'copy' is not defined -- copy

Solution: Import the 'copy' module

# Add the following line to the top of your code
from copy import copy

 

For more information:
copy copy

If the error has not been solved: