Well, it sounds like you’ve followed the instructions about how to install the Blynk Legacy Node.js libary, but you’re trying to use it to compile code written in Python.
Obviously that won’t work, because they are two different programming languages.
I don’t think that there is a Node.js library that’s compatible with Blynk IoT, but if you want to use Python then that doesn’t matter anyway!
The only Blynk Python library compatible with Blynk IoT is v1.0.0 and that isn’t bundled as an installable package.
The files are here:
and you’ll need to manually install them, rather than using the v0.2 bundled release.
I think your syntax for handling virtual pin events is also incorrect. I suspect you’ve used an example from an earlier Python library. You need to look at the examples in the link I provided to find the correct syntax.
TBH, I suspect that you’ve made a poor choice of hardware platform, because the Pi isn’t the easiest platform to work with for this type of project. It requires an OS on an SD card (which will fail eventually) and this makes it slow to boot and high maintenance in terms of updates etc.
Most people choose the ESP32 or similar for Blynk projects, as they are a true standalone microcontroller that lend themselves to this type of project much better. The Pi is great as a small home server, but is a poor choice for an MCU in the type of role you have in mind.
If your project is something like this, then you might find the topic useful…
Pete.