psycopg2 TypeError: not all arguments converted during string formatting

In my case I didn’t realize that you had to pass a tuple to cursor.execute. I had this:

cursor.execute(query, (id))

But I needed to pass a tuple instead

cursor.execute(query, (id,))

Leave a Comment