Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Python executable "/usr/bin/python3" is v3.8.10, which is not supported by gyp #384

Closed
whatwewant opened this issue Mar 18, 2022 · 5 comments · Fixed by #385 or #392
Closed

Python executable "/usr/bin/python3" is v3.8.10, which is not supported by gyp #384

whatwewant opened this issue Mar 18, 2022 · 5 comments · Fixed by #385 or #392

Comments

@whatwewant
Copy link
Contributor

whatwewant commented Mar 18, 2022

Environment

OS: ubuntu 20.04
Python version: 3 (No python2)

cnpm@7.1.1 
npm@6.14.16 
npminstall@5.5.0 
linux x64 5.4.0-100-generic 
registry=https://registry.npmmirror.com

Repreduce

PYTHON=$(which python3) cnpm i raw-socket

Logs

gyp ERR! stack Error: Python executable "/usr/bin/python3" is v3.8.10, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.
gyp ERR! stack     at PythonFinder.failPythonVersion (/home/whatwewant/.nvm/versions/node/v16.5.0/lib/node_modules/cnpm/node_modules/_node-gyp@4.0.0@node-gyp/lib/configure.js:493:19)
gyp ERR! stack     at PythonFinder.<anonymous> (/home/whatwewant/.nvm/versions/node/v16.5.0/lib/node_modules/cnpm/node_modules/_node-gyp@4.0.0@node-gyp/lib/configure.js:475:14)
gyp ERR! stack     at ChildProcess.exithandler (node:child_process:388:7)
gyp ERR! stack     at ChildProcess.emit (node:events:394:28)
gyp ERR! stack     at maybeClose (node:internal/child_process:1067:16)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
gyp ERR! System Linux 5.4.0-100-generic
gyp ERR! command "/home/whatwewant/.nvm/versions/node/v16.5.0/bin/node" "/home/whatwewant/.nvm/versions/node/v16.5.0/lib/node_modules/cnpm/node_modules/_npminstall@5.5.0@npminstall/node-gyp-bin/node-gyp.js" "rebuild"
@whatwewant
Copy link
Contributor Author

node-gyp@^4.0.0 won't be compatible with python3, but node-gyp already support python3.

and after testing, it was found that as long as the upgrade node-gyp@9.0.0 is ok

@whatwewant
Copy link
Contributor Author

@fengmk2 @atian25

@whatwewant
Copy link
Contributor Author

How to reproduce ?

  • OS: ubuntu 20.04
  • Python version: 3 (No python2)
  • Cmd: cnpm i -g raw-socket

@whatwewant
Copy link
Contributor Author

More:

$ cnpm i -g raw-socket
> gyp ERR! stack Error: Can't find Python executable "python", you can set the PYTHON env variable.

$ PYTHON=$(which python3) cnpm i raw-socket
> gyp ERR! stack Error: Python executable "/usr/bin/python3" is v3.8.10, which is not supported by gyp.
gyp ERR! stack You can pass the --python switch to point to Python >= v2.5.0 & < 3.0.0.

@whatwewant whatwewant changed the title Cannot find Python executable "python2 not found", you can set the PYTHON env variable Python executable "/usr/bin/python3" is v3.8.10, which is not supported by gyp Mar 18, 2022
@fengmk2
Copy link
Member

fengmk2 commented Mar 21, 2022

Worked now

PYTHON=$(which python3) cnpm i raw-socket

⠋ [0/1] Installing nan@2.14.*[npminstall:runscript] raw-socket@latest found binding.gyp file, auto run "node-gyp rebuild", root: "/private/tmp/foo/node_modules/_raw-socket@1.7.0@raw-socket"
⠼ [0/1] Installing nan@2.14.*  CXX(target) Release/obj.target/raw/src/raw.o
⠋ [0/1] Installing nan@2.14.*  SOLINK_MODULE(target) Release/raw.node
✔ Installed 1 packages
✔ Linked 2 latest versions
✔ Run 0 scripts
✔ All packages installed (2 packages installed from npm registry, used 6s(network 6s), speed 3.24KB/s, json 1(3.62KB), tarball 15.73KB, manifests cache hit 1, etag hit 1 / miss 0)

fengmk2 added a commit that referenced this issue Mar 24, 2022
fengmk2 added a commit that referenced this issue Mar 24, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants