Closed
Description
- Node Version: Node 17.4.0 npm 8.3.1
- Platform: Darwin Kernel Version 18.7.0
- Compiler: Apple LLVM version 10.0.1 (clang-1001.0.46.4)
Target: x86_64-apple-darwin18.7.0
Thread model: posix - Module: Gatsby Website
node-gyp configure
gyp info using node-gyp@9.0.0
gyp info using node@17.4.0 | darwin | x64
gyp ERR! find Python
gyp ERR! find Python Python is not set from command line or npm configuration
gyp ERR! find Python Python is not set from environment variable PYTHON
gyp ERR! find Python checking if "python3" can be used
gyp ERR! find Python - "python3" is not in PATH or produced an error
gyp ERR! find Python checking if "python" can be used
gyp ERR! find Python - executable path is "/usr/bin/python"
gyp ERR! find Python - version is "2.7.16"
gyp ERR! find Python - version is 2.7.16 - should be >=3.6.0
gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
gyp ERR! find Python
gyp ERR! find Python **********************************************************
gyp ERR! find Python You need to install the latest version of Python.
gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
gyp ERR! find Python you can try one of the following options:
gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
gyp ERR! find Python (accepted by both node-gyp and npm)
gyp ERR! find Python - Set the environment variable PYTHON
gyp ERR! find Python - Set the npm configuration variable python:
gyp ERR! find Python npm config set python "/path/to/pythonexecutable"
gyp ERR! find Python For more information consult the documentation at:
gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
gyp ERR! find Python **********************************************************
gyp ERR! find Python
gyp ERR! configure error
gyp ERR! stack Error: Could not find any Python installation to use
gyp ERR! stack at PythonFinder.fail (/Users/marie-luce/.nvm/versions/node/v17.4.0/lib/node_modules/node-gyp/lib/find-python.js:330:47)
gyp ERR! stack at PythonFinder.runChecks (/Users/marie-luce/.nvm/versions/node/v17.4.0/lib/node_modules/node-gyp/lib/find-python.js:159:21)
gyp ERR! stack at PythonFinder.<anonymous> (/Users/marie-luce/.nvm/versions/node/v17.4.0/lib/node_modules/node-gyp/lib/find-python.js:266:16)
gyp ERR! stack at PythonFinder.execFileCallback (/Users/marie-luce/.nvm/versions/node/v17.4.0/lib/node_modules/node-gyp/lib/find-python.js:297:7)
gyp ERR! stack at ChildProcess.exithandler (node:child_process:390:7)
gyp ERR! stack at ChildProcess.emit (node:events:520:28)
gyp ERR! stack at maybeClose (node:internal/child_process:1090:16)
gyp ERR! stack at Socket.<anonymous> (node:internal/child_process:449:11)
gyp ERR! stack at Socket.emit (node:events:520:28)
gyp ERR! stack at Pipe.<anonymous> (node:net:687:12)
gyp ERR! System Darwin 18.7.0
gyp ERR! command "/Users/marie-luce/.nvm/versions/node/v17.4.0/bin/node" "/Users/marie-luce/.nvm/versions/node/v17.4.0/bin/node-gyp" "configure"
gyp ERR! cwd /Users/marie-luce/Documents/projets/projet/2022/website.com gatsby contentful
gyp ERR! node -v v17.4.0
gyp ERR! node-gyp -v v9.0.0
gyp ERR! not ok ```
</details>
Originally, I had an issue with node-gyp when trying to build a Gatsby Website. I tried node-gyp configure and got this error.
Activity
cclauss commentedon May 12, 2022
Python 2 died 862 days ago on 1/1/2020 so it is no longer supported.
You need a supported version of Python: https://devguide.python.org/#status-of-python-branches
On your Mac, please let us know what it says when you do:
%
sw_vers
mluce194 commentedon May 12, 2022
I installed Python3 with Brew but it either did not work or node-gyp does not seem to find it.
This is what I get when I type sw_vers on my terminal:
cclauss commentedon May 12, 2022
Mine says:
so you are on an older macOS. What do you get when you type:
mluce194 commentedon May 12, 2022
It says:
python@3.10
cclauss commentedon May 12, 2022
Please try to add to your command:
--python=python3
or--python=python3.10
or--python="/usr/local/homebrew/opt/python@3.10/bin/python3"
Like:
mluce194 commentedon May 12, 2022
I tried the 3 commands listed but I always get the same error:
This is weird because I installed python3 but I cannot find the path to it on my mac. When I type
which python3
on my terminal, I do not get any result.cclauss commentedon May 12, 2022
brew doctor
brew list | grep python
brew info python@3.10
mluce194 commentedon May 12, 2022
This is what I get when I run
info python@3.10
:cclauss commentedon May 12, 2022
Do this...
Open a new terminal window / tab and then
python3 --version
mluce194 commentedon May 12, 2022
Opening a new terminal did make things better. When I enter
python3 --version
I get:Python 3.10.4
When I run
node-gyp configure
,it gets better but I still have an error:cclauss commentedon May 12, 2022
Much better.
You need that file even if it is empty.
mluce194 commentedon May 12, 2022
Thanks, it worked!
cclauss commentedon May 12, 2022
The Python@3.10 thing is about https://stackoverflow.com/questions/70587544
Rihyx commentedon Dec 20, 2022
How I fixed the issue.
$ brew install python3
Then fix .zshrc:
$ open ~/.zshrc
And add:
cclauss commentedon Dec 20, 2022
If you had to do
alias python3="/opt/homebrew/bin/python3"
the brew is not properly configured and you might want tobrew doctor
diegomarcuz commentedon Nov 13, 2023
@cclauss where should I create this file?
lakhan-atg commentedon May 29, 2024
gyp ERR! find Python Python is not set from command line or npm configuration gyp ERR! find Python Python is not set from environment variable PYTHON gyp ERR! find Python checking if "python3" can be used gyp ERR! find Python - "python3" is not in PATH or produced an error gyp ERR! find Python checking if "python" can be used gyp ERR! find Python - "python" is not in PATH or produced an error gyp ERR! find Python gyp ERR! find Python ********************************************************** gyp ERR! find Python You need to install the latest version of Python. gyp ERR! find Python Node-gyp should be able to find and use Python. If not, gyp ERR! find Python you can try one of the following options: gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable" gyp ERR! find Python (accepted by both node-gyp and npm) gyp ERR! find Python - Set the environment variable PYTHON gyp ERR! find Python - Set the npm configuration variable python: gyp ERR! find Python npm config set python "/path/to/pythonexecutable" gyp ERR! find Python For more information consult the documentation at: gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
arrmani88 commentedon Dec 20, 2024
In my case, I just had to downgrade node: