在centos中安装jq时遇到问题

时间:2017-05-18 09:53:29

标签: centos jq

在centos上安装jq时,我遇到了一个问题。我运行了以下命令:

yum groupinstall "Development Tools"
yum install autoconf automake libtool python

之后我使用了pip install jq,我遇到了这样的错误:

jq.c:8:22: fatal error: pyconfig.h: No such file or directory
#include "pyconfig.h"
                     ^
compilation terminated.
error: command 'gcc' failed with exit status 1

----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-akuaZu/jq/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read                                                                                        ().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" 
instal --record /tmp/pip-04CW9h-record/install-record.txt --single-version-externally  
-managed --compile" failed with error code 1 in /tmp/pip-build-akuaZu/jq/

任何人都可以帮助我吗?

3 个答案:

答案 0 :(得分:58)

以防万一有人在寻找不同的解决方案。

这就是我在Cent OS 7中的安装方式,它起作用了。确保您拥有 sudo 权限。

安装程序解决方案

yum install epel-release -y
yum install jq -y
jq --version

输出 jq-1.5

Reference

答案 1 :(得分:9)

这就是我在CentOS 7上的安装方式:

wget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64 -O jq
chmod +x jq

然后

mv jq /usr/local/bin

答案 2 :(得分:1)

安装必备软件并安装jq

$ sudo yum -y install https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm

$ sudo yum install jq -y

更多使用信息。https://medium.com/@gchandra/install-jq-on-centos-7-459dd650baa3

相关问题