Could not detect the Python executable based on `npm config ls`
See original GitHub issueI am on Windows, and I have Python 3 in the command line for general Python programming.
$ python --version
Python 3.5.1 :: Continuum Analytics, Inc.
To enable node-gyp
, I use windows-build-tools to install Python 2 and configure npm
as desired:
$ npm config ls
scope = ""
user-agent = "npm/4.3.0 node/v6.3.1 win32 x64"
msvs_version = "2015"
python = "C:\\Users\\username\\.windows-build-tools\\python27\\python.exe"
prefix = "C:\\Users\\username\\AppData\\Roaming\\npm"
I still get the following error while running electron-rebuild
because electron-rebuild
could not find the correct Python 2 based on npm config ls
:
$ npm install zerorpc # the package I could not bind to electron
$ npm install electron electron-rebuild
$ ./node_modules/.bin/electron-rebuild
× Rebuild Failed
An unhandled error occurred inside electron-rebuild
gyp info it worked if it ends with ok
gyp info using node-gyp@3.5.0
gyp info using node@6.3.1 | win32 | x64
gyp ERR! configure error
gyp ERR! stack Error: Can't find Python executable "C:\Anaconda3\python.EXE", you can set the PYTHON env variable.
...
Expected result: no errors, and the package could detect the Python 2 executable properly.
Issue Analytics
- State:
- Created 7 years ago
- Reactions:4
- Comments:5 (1 by maintainers)
Top Results From Across the Web
Could not detect the Python executable based on `npm config ls`
I am on Windows, and I have Python 3 in the command line for general Python programming. $ python --version Python 3.5.1 ::...
Read more >Running Python on Windows for Node.js dependencies
Run the following command using a cmd npm config set python C:\Users\jorge\AppData\Local\Programs\Python\Python310\python.exe. Change the path to your directory.
Read more >npm config set python | The Search Engine You Control
npm - "Can't find Python executable "python", you can set the PYTHON env variable." Asked Dec 19, 2015 • 110 votes 15 answers....
Read more >config | npm Docs
Run npm config ls -l to see a set of configuration parameters that are internal to npm, and are defaults if nothing else...
Read more >HomeAssistant palette installation error - Node-RED Forum
But it might be worth trying at the command line npm config set python $(which python) and then try again to install the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
It is not compatible with python 3.x.x . Try to install ^2.7.x (the lest one).
For people who have the latest version of python, the error message doesn’t help much. It should tell that there is no python, or its version is not compatible.