Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python 3 / choose python interpreter #6

Closed
Dannsei opened this issue Feb 12, 2018 · 3 comments
Closed

Python 3 / choose python interpreter #6

Dannsei opened this issue Feb 12, 2018 · 3 comments

Comments

@Dannsei
Copy link

Dannsei commented Feb 12, 2018

Feature request: it would be nice to have easy way within Node Red to select the Python interpreter to be used. At the moment this goes by default to Python 2.7 rather than Python 3.5.

The manual way to do this is by changing line 18 of PythonshellNode.js to replace 'python' with python3.5 (or python3) i.e. change:

var py = this.spawn('python', [this.pyfile, msg]);

to:

var py = this.spawn('python3.5', [this.pyfile, msg]);

@hans-peter123
Copy link

Sorry, but how to use python3 wir the version 1.1.1?
Because a few things are changed.
Thank you for your help!

@hans-peter123
Copy link

Sorry, I found it by myself: In src/PythonShellNode.js in line 49:
var spawnCmd = (this.virtualenv ? this.virtualenv + '/bin/' : '') + 'python'
to
var spawnCmd = (this.virtualenv ? this.virtualenv + '/bin/' : '') + 'python3'

Thanks!

@namgk
Copy link
Owner

namgk commented Nov 26, 2018

glad you found it. I might incorporate this in a future release. Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants