Hello, @dirka, and welcome to the Processing Foundation Forum!
The reason for the errors is that you have included some Python code in your p5.js script, for example this function definition:
def setup():
global svg_output
size(500, 500)
svg_output = createGraphics(width, height, SVG, "file.svg")