重复此问题: 无法通过PIP安装JQ …但第一个答案有错误(在Windows上支持jq),第二个是指“酿造”,所以我猜是为Mac。
我尝试从Windows命令行安装jq for python,但得到以下错误,可能是由于缺less临时文件\ pip-build-rtnhmg \ jq \ onig-install-5.9.6 file: error: [Error 2] The system cannot find the file specified
…和… Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\<USERNAME>\appdata\local\temp\pip-khvjht-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\
有谁知道这里出了什么问题? searchStackOverflow和谷歌并没有给我太多的继续,我不是很好的Windows和仍然是新的Python / PIP。
这里是全文,减去用户名:
Microsoft Windows [Version 10.0.14393] (c) 2016 Microsoft Corporation. All rights reserved. C:\WINDOWS\system32>pip install jq Collecting jq Using cached jq-0.1.6.tar.gz Building wheels for collected packages: jq Running setup.py bdist_wheel for jq ... error Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" bdist_wheel -dc:\users\<USERNAME>\appdata\local\temp\tmpuvrf_upip-wheel- --python-tag cp27: running bdist_wheel running build running build_ext Executing: ./configure CFLAGS=-fPIC --prefix=c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\onig-install-5.9.6 error: [Error 2] The system cannot find the file specified ---------------------------------------- Failed building wheel for jq Running setup.py clean for jq Failed to build jq Installing collected packages: jq Running setup.py install for jq ... error Complete output from command c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\<USERNAME>\appdata\local\temp\pip-khvjht-record\install-record.txt --single-version-externally-managed --compile: running install running build running build_ext Executing: ./configure CFLAGS=-fPIC --prefix=c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\onig-install-5.9.6 error: [Error 2] The system cannot find the file specified ---------------------------------------- Command "c:\python27\python.exe -u -c "import setuptools, tokenize;__file__='c:\\users\\<USERNAME>\\appdata\\local\\temp\\pip-build-rtnhmg\\jq\\setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record c:\users\<USERNAME>\appdata\local\temp\pip-khvjht-record\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in c:\users\<USERNAME>\appdata\local\temp\pip-build-rtnhmg\jq\
试图安装pyjq,而不是产生相同的错误。
我没有和jq结婚:我只需要在python中格式化json数据,jq在命令行上做的很好。 如果还有其他python包,我应该尝试,请随时推荐他们。 如上所述,但pyjq失败安装与相同的错误。
进一步的细节/步骤:
pip install pyjq
)生成相同的错误。 试图在苹果电脑上pip install jq
,并得到类似的错误:
命令“/usr/local/opt/python/bin/python2.7 -u -c”import setuptools,tokenize; file ='/ private / var / folders / v5 / 4x0py0ns2td1h69vgllx7dpr0000gn / T / pip-build-DyMoT4 / jq / setup.py'; f = getattr(tokenize,'open',open)( file ); code = f.read ().replace('\ r \ n','\ n'); f.close(); exec(compile(code, file ,'exec'))“install –record / var / folders / v5 / 4x0py0ns2td1h69vgllx7dpr0000gn /T/pip-i6UKvt-record/install-record.txt –single-version-external-managed -compile“在/ private / var / folders / v5 / 4x0py0ns2td1h69vgllx7dpr0000gn / T / pip-build- DyMoT4 / JQ /
对于Mac,按照这里build议的步骤( 使用pip安装时出错 )并按照build议成功安装了setuptools,但pip install jq
仍然失败,出现相同的错误。
谢谢。