Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find Python executable "/path/to/executable/python2.7", you can set the PYTHON env variable

[email protected] install /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/bufferutil > node-gyp rebuild gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "/path/to/executable/python2.7", you can set the PYTHON env variable. gyp ERR! stack at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:78:16) gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:82:29) gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:93:16 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15) gyp ERR! System Linux 3.13.0-74-generic gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/bufferutil gyp ERR! node -v v5.3.0 gyp ERR! node-gyp -v v3.2.1 gyp ERR! not ok npm WARN install:[email protected] [email protected] install: node-gyp rebuild npm WARN install:[email protected] Exit status 1 > [email protected] install /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/utf-8-validate > node-gyp rebuild gyp ERR! configure error gyp ERR! stack Error: Can't find Python executable "/path/to/executable/python2.7", you can set the PYTHON env variable. gyp ERR! stack at failNoPython (/usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:401:14) gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/node-gyp/lib/configure.js:330:11 gyp ERR! stack at F (/usr/lib/node_modules/npm/node_modules/which/which.js:78:16) gyp ERR! stack at E (/usr/lib/node_modules/npm/node_modules/which/which.js:82:29) gyp ERR! stack at /usr/lib/node_modules/npm/node_modules/which/which.js:93:16 gyp ERR! stack at FSReqWrap.oncomplete (fs.js:82:15) gyp ERR! System Linux 3.13.0-74-generic gyp ERR! command "/usr/bin/nodejs" "/usr/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild" gyp ERR! cwd /home/sudthenerd/polymer-starter-kit-1.2.1/node_modules/utf-8-validate gyp ERR! node -v v5.3.0 gyp ERR! node-gyp -v v3.2.1 gyp ERR! not ok npm WARN install:[email protected] [email protected] install: node-gyp rebuild npm WARN install:[email protected] Exit status 1

like image 959
SudTheNerd Avatar asked Jan 02 '16 20:01

SudTheNerd


People also ask

Can't find Python executable you can set the Python ENV variable?

To Solve Can't find Python executable “python”, you can set the PYTHON env variable Error You just need to Install Python In Your Windows ( If Not Installed ) and then add python to your PATH variable. Using environment variable. OR You can set npm config set python path and it will also Solve your error.

Does NPM install require Python?

NPM has a package called windows-build-tools that should automatically install everything you need to get node-gyp working, including the Microsoft build tools, compilers, Python, and everything else required to build native Node modules on Windows.

Why does node js need Python?

Python is usually preferred for server-side development, though there are libraries that can support frontend development. It can also be used for developing standalone apps for desktop and mobile. Node. js is an ideal platform for building real-time web applications, gaming, and ecommerce platforms.

How to solve can’t find Python executable “Python”?

Can’t find Python executable “python”, you can set the PYTHON env variable Error? To Solve Can’t find Python executable “python”, you can set the PYTHON env variable Error You just need to install windows-build-tools and then your error will be solved.

Why can't I install Python on my path?

It sounds like Python is not on your path - wherever you installed it to needs to be added to the PATH. I solved a similar error by upgrading the node-sass package to a version that is compatible with my installed Node version. node-sass publishes a compatibility table that I found on their NPM page.

How do I add Python to a PATH variable?

You got to add python to your PATH variable. One thing you can do is Edit your Path variable now and add Your variable PYTHON should point to the root directory of your python installation. Show activity on this post. Show activity on this post.

Is the Python command environment variable set automatically?

I just installed Python 3.7.0 (v3.7.0:1bf9cc5093, Jun 27 2018, 04:06:47) and the python command environment variable is not setup automatically, but py is. So the docs and/or scripts need to be updated I think.


2 Answers

Scott Frees' solution didn't work for me but running

npm config set python $(which python)

did.

like image 154
Kodie Grantham Avatar answered Sep 18 '22 08:09

Kodie Grantham


If you installed Python using a package manager, it should already be on your path- but if not: add it like this:

export PATH="$PATH:/usr/local/bin/python (or wherever you installed python to)

Node-gyp requires 2.x and cannot use Python3 (do you have the right version installed?).

See Running Python on Windows for Node.js dependencies for Windows to make sure you have your environment variable set.

like image 35
Scott Frees Avatar answered Sep 20 '22 08:09

Scott Frees