Skip to content
This repository was archived by the owner on Jul 28, 2024. It is now read-only.
This repository was archived by the owner on Jul 28, 2024. It is now read-only.

Node-Gyp can't find Python 3 #228

@selfagency

Description

@selfagency

This started happening to our builds recently:

Step #15 - "build_client": gyp info using node@16.13.2 | linux | x64
Step #15 - "build_client": gyp ERR! find Python 
Step #15 - "build_client": gyp ERR! find Python Python is not set from command line or npm configuration
Step #15 - "build_client": gyp ERR! find Python Python is not set from environment variable PYTHON
Step #15 - "build_client": gyp ERR! find Python checking if \"python3\" can be used
Step #15 - "build_client": gyp ERR! find Python - \"python3\" is not in PATH or produced an error
Step #15 - "build_client": gyp ERR! find Python checking if \"python\" can be used
Step #15 - "build_client": gyp ERR! find Python - executable path is \"/usr/bin/python\"
Step #15 - "build_client": gyp ERR! find Python - version is \"2.7.12\"
Step #15 - "build_client": gyp ERR! find Python - version is 2.7.12 - should be >=3.6.0
Step #15 - "build_client": gyp ERR! find Python - THIS VERSION OF PYTHON IS NOT SUPPORTED
Step #15 - "build_client": gyp ERR! find Python 
Step #15 - "build_client": gyp ERR! find Python **********************************************************
Step #15 - "build_client": gyp ERR! find Python You need to install the latest version of Python.
Step #15 - "build_client": gyp ERR! find Python Node-gyp should be able to find and use Python. If not,
Step #15 - "build_client": gyp ERR! find Python you can try one of the following options:
Step #15 - "build_client": gyp ERR! find Python - Use the switch --python=\"/path/to/pythonexecutable\"
Step #15 - "build_client": gyp ERR! find Python   (accepted by both node-gyp and npm)
Step #15 - "build_client": gyp ERR! find Python - Set the environment variable PYTHON
Step #15 - "build_client": gyp ERR! find Python - Set the npm configuration variable python:
Step #15 - "build_client": gyp ERR! find Python   npm config set python \"/path/to/pythonexecutable\"
Step #15 - "build_client": gyp ERR! find Python For more information consult the documentation at:
Step #15 - "build_client": gyp ERR! find Python https://github.com/nodejs/node-gyp#installation
Step #15 - "build_client": gyp ERR! find Python **********************************************************
Step #15 - "build_client": gyp ERR! find Python 
Step #15 - "build_client": gyp ERR! configure error 
Step #15 - "build_client": gyp ERR! stack Error: Could not find any Python installation to use
Step #15 - "build_client": gyp ERR! stack     at PythonFinder.fail (/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:330:47)
Step #15 - "build_client": gyp ERR! stack     at PythonFinder.runChecks (/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:159:21)
Step #15 - "build_client": gyp ERR! stack     at PythonFinder.<anonymous> (/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:266:16)
Step #15 - "build_client": gyp ERR! stack     at PythonFinder.execFileCallback (/nodejs/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:297:7)
Step #15 - "build_client": gyp ERR! stack     at ChildProcess.exithandler (node:child_process:388:7)
Step #15 - "build_client": gyp ERR! stack     at ChildProcess.emit (node:events:390:28)
Step #15 - "build_client": gyp ERR! stack     at maybeClose (node:internal/child_process:1064:16)
Step #15 - "build_client": gyp ERR! stack     at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
Step #15 - "build_client": gyp ERR! System Linux 5.4.0-1058-gcp

I ran some checks inside the container and sure enough, there's no python3 available to the user. But...it comes standard in Ubuntu 16+. So what's up with that?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions