1

I am trying to build a image for deploying a code on google cloud run with the jsonnet python package, it fails to install jsonnet with following error. Any ideas what can I do to resolve this?

Running setup.py install for jsonnet: started
Running setup.py install for jsonnet: finished with status 'error'
[91m    ERROR: Command errored out with exit status 1:
     command: /usr/local/bin/python -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-omf9pb8l/jsonnet_ec2d6dbf69014cee8b4fe5227a52a519/setup.py'"'"'; __file__='"'"'/tmp/pip-install-omf9pb8l/jsonnet_ec2d6dbf69014cee8b4fe5227a52a519/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-3h0ew2u0/install-record.txt --single-version-externally-managed --compile --install-headers /usr/local/include/python3.8/jsonnet
         cwd: /tmp/pip-install-omf9pb8l/jsonnet_ec2d6dbf69014cee8b4fe5227a52a519/
    Complete output (4 lines):
    running install
    running build
    running build_ext
    error: [Errno 2] No such file or directory: 'make'
    ----------------------------------------
Duumb Eeee
  • 56
  • 6
  • Is the error being thrown in a Docker build? `jsonnet` is written in C(++) and the Python package is a wrapper around that. When you install the package, it tries to compile `jsonnet` and is failing. It's unable to find `make` (a build tool that will invoke the compiler). If you're using Docker, you can `apt-get install -y build-essental` to get `make` and `gcc` which should fix this. – DazWilkin Dec 27 '20 at 01:30
  • 1
    Thanks @DazWilkin I included build-essential in the docker file and it worked. – Duumb Eeee Dec 27 '20 at 18:43

1 Answers1

2

As Mr DazWilkin says the error is linked to compilation. To solve the problem you must install make with apt-get -y install build-essential

For example RUN apt update -y && apt -y install build-essential git && git clone https://github.com/google/jsonnet.git && cd jsonnet && make

For more information

Ezekias BOKOVE
  • 148
  • 1
  • 7