4
%pip install jq

returns the following error

  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\myacn\anaconda3\python.exe' 'C:\Users\myacn\anaconda3\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\myacn\AppData\Local\Temp\tmpygza7t_7'
       cwd: C:\Users\myacn\AppData\Local\Temp\pip-install-l6yh1hi9\jq
  Complete output (7 lines):
  running bdist_wheel
  running build
  running build_ext
  Downloading https://github.com/kkos/oniguruma/releases/download/v6.9.4/onig-6.9.4.tar.gz
  Downloaded https://github.com/kkos/oniguruma/releases/download/v6.9.4/onig-6.9.4.tar.gz
  Executing: ./configure CFLAGS=-fPIC --prefix=C:\Users\myacn\AppData\Local\Temp\pip-install-l6yh1hi9\jq\_deps\onig-install-6.9.4
  error: [WinError 2] The system cannot find the file specified
  ----------------------------------------
  ERROR: Failed building wheel for jq
ERROR: Could not build wheels for jq which use PEP 517 and cannot be installed directly

Looking online this link resolves for mac and linux, I'm not entirely familiar with the right installation for windows, trying %pip install autoconf automake libtool gives

Collecting autoconf
  Using cached autoconf-0.7.1-py3-none-any.whl (10 kB)
Note: you may need to restart the kernel to use updated packages.
ERROR: Could not find a version that satisfies the requirement automake (from versions: none)
ERROR: No matching distribution found for automake
Collecting jq
  Using cached jq-1.1.1.tar.gz (69 kB)
  Installing build dependencies: started
  Installing build dependencies: finished with status 'done'
  Getting requirements to build wheel: started
  Getting requirements to build wheel: finished with status 'done'
    Preparing wheel metadata: started
    Preparing wheel metadata: finished with status 'done'
Building wheels for collected packages: jq
  Building wheel for jq (PEP 517): started
  Building wheel for jq (PEP 517): finished with status 'error'
Failed to build jq
Note: you may need to restart the kernel to use updated packages.
LOAD DURATION:  0:00:11.548563
  ERROR: Command errored out with exit status 1:
   command: 'C:\Users\myacn\anaconda3\python.exe' 'C:\Users\myacn\anaconda3\lib\site-packages\pip\_vendor\pep517\_in_process.py' build_wheel 'C:\Users\myacn\AppData\Local\Temp\tmpygza7t_7'
       cwd: C:\Users\myacn\AppData\Local\Temp\pip-install-l6yh1hi9\jq
  Complete output (7 lines):
  running bdist_wheel
  running build
  running build_ext
  Downloading https://github.com/kkos/oniguruma/releases/download/v6.9.4/onig-6.9.4.tar.gz
  Downloaded https://github.com/kkos/oniguruma/releases/download/v6.9.4/onig-6.9.4.tar.gz
  Executing: ./configure CFLAGS=-fPIC --prefix=C:\Users\myacn\AppData\Local\Temp\pip-install-l6yh1hi9\jq\_deps\onig-install-6.9.4
  error: [WinError 2] The system cannot find the file specified
  ----------------------------------------
  ERROR: Failed building wheel for jq
ERROR: Could not build wheels for jq which use PEP 517 and cannot be installed directly

Seems like automake was the issue.

Reading another thread here, the error message is slightly different: the link talks about bottleneck, but mine does not. Going through that thread I first tried downgrading pip pip install pip==18.1, restarted kernel,

Here's the new errror:

  Failed building wheel for jq
Command "C:\Users\myacn\anaconda3\python.exe -u -c "import setuptools, tokenize;__file__='C:\\Users\\myacn\\AppData\\Local\\Temp\\pip-install-m3mejes3\\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\myacn\AppData\Local\Temp\pip-record-_38z9t11\install-record.txt --single-version-externally-managed --compile" failed with error code 1 in C:\Users\myacn\AppData\Local\Temp\pip-install-m3mejes3\jq\
You are using pip version 18.1, however version 20.3b1 is available.
You should consider upgrading via the 'python -m pip install --upgrade pip' command.

I then downloaded Visual Studio, specifically checking C++ install tools like the steps indicated; I tried re-running with updated pip and 18.1, and get the same errors.

halfer
  • 19,824
  • 17
  • 99
  • 186
zliangmd
  • 167
  • 1
  • 5
  • 1
    The package doesn't seem to have been built to support Windows. Unless you are familiar with porting C++ code between different architectures and toolchains, probably just abandon this effort for now. – tripleee Nov 13 '20 at 06:28
  • thanks for the information tripleee, this is for a graded assignment :( or, if anyone might know, is there an equivalent package on windows? as I interpret jq is just a json reader – zliangmd Nov 13 '20 at 17:28
  • https://stedolan.github.io/jq/download/ has Windows binaries... – Shawn Nov 13 '20 at 17:38
  • 2
    But this is for Python bindings to the library. If you are just looking for the command-line tool, indeed, install that from Stedolan. `pip` is for installing Python libraries, nothing else. – tripleee Nov 13 '20 at 18:19
  • thanks Shawn, the executables said they should just run, but they didn't so I installed the package with chocolatey, and cmd reads: "The install of jq was successful. Software install location not explicitly set, could be in package or default install location if installer. Chocolatey installed 1/1 packages." Now when I try importing jq in Jupyter I still get the same error no module named 'jq'. Thanks for getting me this close, just a little push across the finish line. – zliangmd Nov 13 '20 at 18:21
  • I think you're confused between Python modules and chocolatey modules. The two aren't the same--pip is a package manager for Python modules, chocolatey is a package manager for Windows apps. If you install it with chocolatey, you can run it in powershell or command but you can't import it as if it's a Python module. Install it with pip if you want a Python module, install it with chocolatey if you want a command line utility. – ggorlen Nov 19 '20 at 07:23
  • 1
    "jq is just a JSON reader" -- possibly you have an xy problem? jq is far more than just a JSON reader--it's a well-featured programming language for manipulating JSON structures. If you just need to "read" JSON, maybe `import json` and `json.loads(s)`? What are you trying to achieve that you need jq for? Having said that, I was able to reproduce the install error you saw on my Windows machine, so it's a legitimate problem. – ggorlen Nov 19 '20 at 07:32

0 Answers0