I am trying to read a yaml file in gitlab CI. I installed jq==1.0.2
and yq==2.10.1
using pip
in my CI job and I use python:3.7 image. When I tried to read the yaml file, it has the error
yq: Error starting jq: FileNotFoundError: [Errno 2] No such file or directory: 'jq': 'jq'. Is jq installed and available on PATH?
My yaml file is not call jq and I do have this yaml file in my commit. I am able to do which yq
, when I do which jq
, the CI job failed. Anyone has any idea?
Your jq
installation is not quite correct. Your version information jq==1.0.2
indicates that you have installed the python package jq
- https://pypi.org/project/jq/ which is not the same as the executable binary jq
that gets installed. You need the executable to be installed, before invoking the yq
tool.
Since yq
looks in PATH
for availability of the jq
binary, but doesn't find it, you get the runtime error indicating the absence. The fix will be setup your CI to download the jq
binary from one of the steps mentioned in https://stedolan.github.io/jq/download/
Run sudo apt-get install jq
not pip3 install jq
.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With