google / jsonnet

Jsonnet - The data templating language
http://jsonnet.org
Apache License 2.0
6.87k stars 436 forks source link

Unable to install jsonnet in Google Colab notebook: failed building wheel #1122

Open larkinbb opened 6 months ago

larkinbb commented 6 months ago

I need to download jsonnet as part of my allennlp 1.3 installation in Google Colab (using Python 3.8 in order to use PyTorch 1.7.0). I'm getting this error:

Building wheels for collected packages: overrides, jsonnet
  Building wheel for overrides (setup.py) ... done
  Created wheel for overrides: filename=overrides-3.1.0-py3-none-any.whl size=10171 sha256=fe853b5f2bc4f3861862991949f0fb59ddd52e9c8bf5bd271e72ebc42008d4f4
  Stored in directory: /root/.cache/pip/wheels/6a/4f/72/28857f75625b263e2e3f5ab2fc4416c0a85960ac6485007eaa
  error: subprocess-exited-with-error

  × python setup.py bdist_wheel did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Building wheel for jsonnet (setup.py) ... error
  ERROR: Failed building wheel for jsonnet
  Running setup.py clean for jsonnet
Successfully built overrides
Failed to build jsonnet
Installing collected packages: wasabi, tokenizers, sentencepiece, plac, overrides, jsonnet, filelock, cymem, urllib3, typing-extensions, tqdm, tomli, threadpoolctl, srsly, regex, protobuf, pluggy, packaging, numpy, murmurhash, jsonpickle, joblib, jmespath, iniconfig, idna, exceptiongroup, click, charset-normalizer, certifi, catalogue, torch, tensorboardX, scipy, sacremoses, requests, pytest, preshed, nltk, h5py, botocore, blis, transformers, thinc, scikit-learn, s3transfer, spacy, boto3, allennlp
  error: subprocess-exited-with-error

  × Running setup.py install for jsonnet did not run successfully.
  │ exit code: 1
  ╰─> See above for output.

  note: This error originates from a subprocess, and is likely not a problem with pip.
  Running setup.py install for jsonnet ... error
error: legacy-install-failure

× Encountered error while trying to install package.
╰─> jsonnet

note: This is an issue with the package mentioned above, not pip.
hint: See above for output from the failure.

I've tried these fixes from other posts about the issue, but it hasn't worked:

%%bash
git clone https://github.com/google/jsonnet.git
cd jsonnet
make
sudo mv jsonnet /usr/local/bin

!pip install Cmake
!pip install wheel setuptools --upgrade

import setuptools
from setuptools import setup

!apt-get -y install build-essential

!sudo apt-get remove --auto-remove libav-tools 
!apt-get install python-dev libxml2-dev libxslt1-dev antiword unrtf poppler-utils \
     pstotext tesseract-ocr \
     flac ffmpeg lame libmad0 libsox-fmt-mp3 sox libjpeg-dev swig libasound2-dev libpulse-dev

!pip install make

!pip install jsonnet

Many existing posts (ex) find it to be a Mac/Windows issue, but I'm using Google Colab.