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 not found but it is installed #564

Closed
jkutner opened this issue Sep 29, 2022 · 2 comments
Closed

Python not found but it is installed #564

jkutner opened this issue Sep 29, 2022 · 2 comments
Labels

Comments

@jkutner
Copy link

jkutner commented Sep 29, 2022

Environment details

  • OS: Docker (Ubuntu)
  • OS version: 20.04
  • node-pty version: latest

Issue description

While trying to npm install node-pty, it cannot find python:

$ /usr/bin/python --version
Python 3.8.10

$ npm install node-pty
...
npm ERR! code 1
npm ERR! path /layers/jkutner_wetty/wetty/node_modules/node-pty
npm ERR! command failed
npm ERR! command sh -c -- node scripts/install.js
npm ERR! gyp info it worked if it ends with ok
npm ERR! gyp info using [email protected]
npm ERR! gyp info using [email protected] | linux | x64
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! find Python checking Python explicitly set from NODE_GYP_FORCE_PYTHON
npm ERR! gyp ERR! find Python - process.env.NODE_GYP_FORCE_PYTHON is "/usr/bin/python"
npm ERR! gyp ERR! find Python - "/usr/bin/python" is not in PATH or produced an error
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python You need to install the latest version of Python.
npm ERR! gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
npm ERR! gyp ERR! find Python you can try one of the following options:
npm ERR! gyp ERR! find Python - Use the switch --python="/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python   (accepted by both node-gyp and npm)
npm ERR! gyp ERR! find Python - Set the environment variable PYTHON
npm ERR! gyp ERR! find Python - Set the npm configuration variable python:
npm ERR! gyp ERR! find Python   npm config set python "/path/to/pythonexecutable"
npm ERR! gyp ERR! find Python For more information consult the documentation at:
npm ERR! gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
npm ERR! gyp ERR! find Python **********************************************************
npm ERR! gyp ERR! find Python 
npm ERR! gyp ERR! configure error 
npm ERR! gyp ERR! stack Error: Could not find any Python installation to use
npm ERR! gyp ERR! stack     at PythonFinder.fail (/layers/jkutner_wetty/wetty/node_modules/node-gyp/lib/find-python.js:330:47)
npm ERR! gyp ERR! stack     at PythonFinder.runChecks (/layers/jkutner_wetty/wetty/node_modules/node-gyp/lib/find-python.js:159:21)
npm ERR! gyp ERR! stack     at PythonFinder.<anonymous> (/layers/jkutner_wetty/wetty/node_modules/node-gyp/lib/find-python.js:202:16)
npm ERR! gyp ERR! stack     at PythonFinder.execFileCallback (/layers/jkutner_wetty/wetty/node_modules/node-gyp/lib/find-python.js:294:16)
npm ERR! gyp ERR! stack     at ChildProcess.exithandler (node:child_process:420:5)
npm ERR! gyp ERR! stack     at ChildProcess.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at maybeClose (node:internal/child_process:1091:16)
npm ERR! gyp ERR! stack     at Socket.<anonymous> (node:internal/child_process:449:11)
npm ERR! gyp ERR! stack     at Socket.emit (node:events:513:28)
npm ERR! gyp ERR! stack     at Pipe.<anonymous> (node:net:313:12)
npm ERR! gyp ERR! System Linux 5.10.104-linuxkit
npm ERR! gyp ERR! command "/layers/heroku_nodejs-engine/dist/bin/node" "/layers/jkutner_wetty/wetty/node_modules/.bin/node-gyp" "rebuild"
npm ERR! gyp ERR! cwd /layers/jkutner_wetty/wetty/node_modules/node-pty
npm ERR! gyp ERR! node -v v18.9.1
npm ERR! gyp ERR! node-gyp -v v9.1.0
npm ERR! gyp ERR! not ok

What might be wrong?

@daniel-brenot
Copy link
Contributor

If you do python --version instead of doing the full path does the command work?

Chances are that python isn't in your PATH which would be why it cant find ot.

@Tyriar
Copy link
Member

Tyriar commented Nov 30, 2022

Yeah this looks like an issue in your environment as node-gyp can't find Python. Following the instructions in the error or adding it to PATH manually will probably fix the problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants