Node-gyp: Gyp should check for python2 executable if default python is 3

Created on 5 Nov 2014  Â·  6Comments  Â·  Source: nodejs/node-gyp

It's fairly standard these days (at least in *nix flavors) to have "python2" and "python3" binaries installed in an environment where both versions are used. Ideally gyp should check for a python2 executable in the path.

Gyp currently allows explicitly setting --python, however one should only need to use this in special cases, not every time npm is called. You can also set the PYTHON environment variable in your .bashrc, but this variable is fairly generic and might affect other programs that depend on it to mean "the default python on this system".

Most helpful comment

@denzelwamburu yes, just run

npm config set python /usr/bin/python2.7
npm install

and enjoy :)

All 6 comments

So in simple terms it cant run if your machine is running python 3.x

Technically it can run if you specify the -python flag each time, but ideally this shouldn't be necessary in the default use case.

I have trying npm installing bcrypt but still rejects due to my version 3 of python. Anyway to get around it?

@denzelwamburu yes, just run

npm config set python /usr/bin/python2.7
npm install

and enjoy :)

Thanks lots. You can close the issue
On Nov 28, 2014 3:10 PM, "Julian Xhokaxhiu" [email protected]
wrote:

@denzelwamburu https://github.com/denzelwamburu yes, just run

npm config set python /usr/bin/python2.7
npm install

and enjoy :)

—
Reply to this email directly or view it on GitHub
https://github.com/TooTallNate/node-gyp/issues/526#issuecomment-64887659
.

Fixed by #527.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

swaj picture swaj  Â·  3Comments

halkar picture halkar  Â·  4Comments

Sentero-esp12 picture Sentero-esp12  Â·  3Comments

jhermsmeier picture jhermsmeier  Â·  3Comments

jlchereau picture jlchereau  Â·  3Comments