I can not understand what the error is.
from prettytable import PrettyTable x = PrettyTable() x.field_names = [] x.field_names.append("example") x.add_row(["Example"]) print(x) KeyError: 'example' After calling x, an error "KeyError" occurs, and it occurs only when I add elements to the x.field_names list using the methods append, insert, etc., while manually adding any problems.