复制这个问题,但是第一个答案是错误的(jq在Windows上是支持的),第二个是指brew,所以我猜是针对brew的。
视窗
我试图从Windows命令行安装jq for python,但是得到以下错误,可能是由于缺少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\
有人知道这里出了什么问题吗?在StackOverflow和Google上的搜索并没有给我提供更多的东西,而且我对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 -d c:\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在安装过程中出现了同样的错误。
采取的进一步细节/步骤:
setuptools和pip,使用从这里开始的台阶 .没有注意到问题。pip install pyjq)会产生同样的错误。pip install jq,得到了类似的错误:
Command "/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-externally-managed --compile" failed with error code 1 in /private/var/folders/v5/4x0py0ns2td1h69vgllx7dpr0000gn/T/pip-build-DyMoT4/jq/setuptools,但是pip install jq仍然失败,出现相同的错误。发布于 2018-04-17 15:36:39
通过pip安装
根据安装步骤为pip的项目:
安装需要构建
jq所需的任何程序。这包括:
libtoolmacOS
在macOS上,需要安装XCode和以下软件包:
brew install autoconf automake libtool
brew install jqLinux
您需要安装下列软件包:
yum install autoconf automake libtool pythonhttps://stackoverflow.com/questions/42262960
复制相似问题