Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't find Python executable

Tags:

python

node.js

Error: Can't find Python executable "D:\Python", you can set the PYTHON env variable. at PythonFinder.failNoPython (C:\Program Files\nodejs\node_modules\npm\node_modules\node-gyp\lib\configure.js:483:19)

I do have python installed (2.7.14) in D:\Python, and I have setup the environment variables enter image description here

I also tried SET PYTHON=D:\Python.

python command from command line works fine.

python.exe is in D:\Python enter image description here

What am I doing wrong ?

like image 926
Valera Avatar asked Nov 27 '17 10:11

Valera


People also ask

What is Python executable path?

The Python executable could be in a directory in C:\Python\ or in your AppData\ folder, for instance. If the executable were in AppData\ , then the path would typically look something like this: C:\Users\<USER>\AppData\Local\Programs\Python.


1 Answers

It turns out that node-gyp does not take variables from windows environment, and you have to set them like this:

npm config set python D:\python

I was installing sharp, not node-gyp, that's why I did't pay attention to their documentation that has this command:

npm install --global --production windows-build-tools

which will install all for you and set the paths. I used this command and was finally able to successfully run npm install.

Note: you need to run this command as administrator

like image 59
Valera Avatar answered Sep 21 '22 06:09

Valera