Error: Could not find any Python installation to use: (libvips throws error during docker-compose launch)
alexshchur opened this issue · 3 comments
alexshchur commented
Current behavior
Upon running docker-compose, I'm getting following error:
$ docker-compose -f docker-compose.yml up -d
Building app
Step 1/9 : FROM node:10-alpine
---> 955e0e1f1a41
Step 2/9 : ENV VS_ENV prod
---> Using cache
---> f2383bb3b22e
Step 3/9 : WORKDIR /var/www
---> Using cache
---> a830b39a94a3
Step 4/9 : RUN apk add --no-cache curl git
---> Using cache
---> 962366f16948
Step 5/9 : COPY package.json ./
---> Using cache
---> 8044e9e0a9d9
Step 6/9 : COPY yarn.lock ./
---> Using cache
---> e207dbf74e6c
Step 7/9 : RUN apk add --no-cache --virtual .build-deps ca-certificates wget && yarn install --no-cache && apk del .build-deps
---> Running in 20f01d107c4a
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/2) Installing wget (1.20.3-r0)
(2/2) Installing .build-deps (20200215.064709)
Executing busybox-1.31.1-r9.trigger
OK: 24 MiB in 25 packages
yarn install v1.21.1
[1/4] Resolving packages...
[2/4] Fetching packages...
warning url-loader@1.1.2: Invalid bin field for "url-loader".
warning sha.js@2.4.11: Invalid bin entry for "sha.js" (in "sha.js").
info fsevents@1.2.9: The platform "linux" is incompatible with this module.
info "fsevents@1.2.9" is an optional dependency and failed compatibility check. Excluding it from installation.
[3/4] Linking dependencies...
[4/4] Building fresh packages...
error /var/www/node_modules/sharp: Command failed.
Exit code: 1
Command: (node install/libvips && node install/dll-copy && prebuild-install) || (node-gyp rebuild && node install/dll-copy)
Arguments:
Directory: /var/www/node_modules/sharp
Output:
info sharp Downloading https://github.com/lovell/sharp-libvips/releases/download/v8.7.4/libvips-8.7.4-linuxmusl-x64.tar.gz
Segmentation fault (core dumped)
gyp info it worked if it ends with ok
gyp info using node-gyp@5.0.5
gyp info using node@10.19.0 | linux | x64
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:301:5)
gyp ERR! stack at ChildProcess.errorhandler (child_process.js:313:5)
gyp ERR! stack at ChildProcess.emit (events.js:198:13)
gyp ERR! stack at Process.ChildProcess._handle.onexit (internal/child_process.js:246:12)
gyp ERR! stack at onErrorNT (internal/child_process.js:415:16)
gyp ERR! stack at process._tickCallback (internal/process/next_tick.js:63:19)
gyp ERR! System Linux 4.15.0-74-generic
gyp ERR! command "/usr/local/bin/node" "/usr/local/lib/node_modules/npm/node_modules/node-gyp/bin/node-gyp.js" "rebuild"
gyp ERR! cwd /var/www/node_modules/sharp
gyp ERR! node -v v10.19.0
gyp ERR! node-gyp -v v5.0.5
gyp ERR! not ok
info Visit https://yarnpkg.com/en/docs/cli/install for documentation about this command.
ERROR: Service 'app' failed to build: The command '/bin/sh -c apk add --no-cache --virtual .build-deps ca-certificates wget && yarn install --no-cache && apk del .build-deps' returned a non-zero code: 1
Expected behavior
Docker machines are successfully set up
Steps to reproduce the issue
Run docker-compose in the root folder of the project
$ docker-compose -f docker-compose.yml up -d
Repository
N/A
Can you handle fixing this bug by yourself?
- YES
- NO
Environment details
- OS: Ubuntu 18.04
- Node: n/a (docker)
- Code Version:
Additional information
miladezzat commented
i see this bug again
miladezzat commented
@pkarw
please help, this bug return again
PawFV commented
Solved with the following:
RUN apk add --update --no-cache python make g++ \
ca-certificates \
curl \
git \
wget