Docker-node: node:lts-slim missing python

Created on 29 Oct 2020  路  8Comments  路  Source: nodejs/docker-node

We use the node:lts-slim image for months in multiple gitlab pipelines and it worked on 27th October 6PM, that was the last time a successful pipeline ran. The next pipeline on 28th October 11AM was broken and all pipelines afterwards.
We triggered the pipeline, which ran successfully on 27th October 6PM, again to verify that the image is broken.
The pipeline broke without changing a single line of code.

Verified that behaviour 2 min ago, still broken.

We use the image node:15 right now, that is working as expected as long the node:lts-slim is broken.

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 "python" can be used gyp ERR! find Python - "python" is not in PATH or produced an error gyp ERR! find Python checking if "python2" can be used gyp ERR! find Python - "python2" is not in PATH or produced an error 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 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 (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:307:47) gyp ERR! stack at PythonFinder.runChecks (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:136:21) gyp ERR! stack at PythonFinder.<anonymous> (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:179:16) gyp ERR! stack at PythonFinder.execFileCallback (/usr/local/lib/node_modules/npm/node_modules/node-gyp/lib/find-python.js:271:16) gyp ERR! stack at exithandler (child_process.js:315:5) gyp ERR! stack at ChildProcess.errorhandler (child_process.js:327:5) gyp ERR! stack at ChildProcess.emit (events.js:315:20) gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12) gyp ERR! stack at onErrorNT (internal/child_process.js:465:16) gyp ERR! stack at processTicksAndRejections (internal/process/task_queues.js:80:21)

question

Most helpful comment

@zacharytyhacz
I have build my own image based on the node:lts-slim image with python installed.
```
FROM node:lts-slim

RUN apt-get update || : && apt-get install -y \
python \
build-essential

CMD ["node"]

All 8 comments

Slim has never included python https://github.com/nodejs/docker-node/issues/12#issuecomment-84025397

Thanks for your response. Hmm, that's strange. A build that successfully ran before was retried with the same code and then was broken. I was thinking later that evening "is python included in the slim?" but it ran fine for months.
It's failing on "lerna bootstrap --nohoist *" of the lerna monorepo.
I will inspect that further, thanks for clarification.

Got to this issue because the exact same thing happened to me.

I imagine there's a common dependency that's been updated and probably either used to have a compatible wheel and no longer does or used to not need gyp and now does. 馃様

My guess is some module had precompiled binaries for node 12, but does not at this time have that for node 14. So something is building from source instead of just downloading something. As @nschonni says, the slim image haven't been bundling python before, and we're not gonna do so now.

$ docker run node:12-slim sh -c 'python --version'
sh: 1: python: not found
$ docker run node:12 sh -c 'python --version'
Python 2.7.13
$ docker run node:14-slim sh -c 'python --version'
sh: 1: python: not found
$ docker run node:14 sh -c 'python --version'
Python 2.7.13

So this is not a regression in the slim image. @Cr4mble node:lts-slim swapped from v12 to v14 when v14 was made LTS Tuesday this week, which is why you're hitting this now. But it is not a bug, or something we're gonna change, so I'll close this.

@SimenB that makes all the sense. Sorry for the brevity in my previous comment.

@dulvac how to install python then?

no solutions on this issue work for me

@zacharytyhacz
I have build my own image based on the node:lts-slim image with python installed.
```
FROM node:lts-slim

RUN apt-get update || : && apt-get install -y \
python \
build-essential

CMD ["node"]

Was this page helpful?
0 / 5 - 0 ratings

Related issues

eyaylagul picture eyaylagul  路  3Comments

actualben picture actualben  路  3Comments

retrohacker picture retrohacker  路  3Comments

kmleow picture kmleow  路  5Comments

kmetsalu picture kmetsalu  路  5Comments