arnauorriols / node-red-contrib-python-function

Write Python functions in Node-RED!
MIT License
41 stars 23 forks source link

Python3 #13

Closed xirami closed 1 year ago

xirami commented 3 years ago

Hi,

in order to have successfully working Python 3 code on Debian kind of systems, command has to be changed to

    function spawnFn(self) {
        self.child = spawn('python3', ['-uc', self.func.code], {
            stdio: ['pipe', 'pipe', 'pipe', 'ipc']
        });
noobydp commented 3 years ago

I also have this issue. I'm running Node-Red in docker on Unraid, and it has both python and python3. This module always uses python (i.e. v2)

tedvdb commented 3 years ago

It would be nice if someone would implement a "python selector" that allows us to pick which python interpreter should be used. I'm not skilled enough in JS to implement this tough. 😞

DPAmes commented 2 years ago

Same issue. Took me a while to figure out why my included library was crashing with a syntax error. I'm not sure how to incorporate ondrejspilka's solution. I'll try to figure it out.

jacobgarder commented 1 year ago

Same issue with the official docker image, version 3.0.2.