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

node:lts-slim missing python #1385

Closed
Cr4mble opened this issue Oct 29, 2020 · 11 comments
Closed

node:lts-slim missing python #1385

Cr4mble opened this issue Oct 29, 2020 · 11 comments
Labels

Comments

@Cr4mble
Copy link

Cr4mble commented Oct 29, 2020

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)```
@nschonni
Copy link
Member

Slim has never included python #12 (comment)

@Cr4mble
Copy link
Author

Cr4mble commented Oct 30, 2020

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.

@dulvac
Copy link

dulvac commented Oct 30, 2020

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

@tianon
Copy link
Contributor

tianon commented Oct 30, 2020

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. 😔

@SimenB
Copy link
Member

SimenB commented Oct 30, 2020

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 SimenB closed this as completed Oct 30, 2020
@dulvac
Copy link

dulvac commented Oct 30, 2020

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

@zacharytyhacz
Copy link

@dulvac how to install python then?

no solutions on this issue work for me

@Cr4mble
Copy link
Author

Cr4mble commented Nov 16, 2020

@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"]

@philip-nicholls
Copy link

Did not work for me. I had to specifically call it python3 instead of python

@zacharytyhacz
Copy link

What docker image version are you using? python for most latest version Linux distros should be python3 now. If you're using an older image / older alpine linux version then that may be the case for you.

@philip-nicholls
Copy link

I was using node:16-slim and needed to install python3
but node:lts-slim is currently pointing to node:18-slim which is even more modern, so I don't think the code from Cr4mble will work today.
Perhaps when he posted in 2020, the LTS was something older such as node 14. This is exactly why I don't use lts tag in dockerfiles

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

7 participants