Describe the bug
I am getting the following stacktrace error when attempting to install with the command pip install allennlp. It is failing on jsonnet package but I don't know why.
Failed building wheel for jsonnet
Running setup.py clean for jsonnet
Failed to build jsonnet
Installing collected packages: jsonnet, allennlp, jsondiff, aws-xray-sdk, atomicwrites, attrs, asn1crypto, alabaster
Running setup.py install for jsonnet ... error
Complete output from command /usr/local/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/sp/4bfpfrfd4m3bx3nl84rvwd5w0000gn/T/pip-install-s0sa1az1/jsonnet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/sp/4bfpfrfd4m3bx3nl84rvwd5w0000gn/T/pip-record-akb978cv/install-record.txt --single-version-externally-managed --compile:
running install
running build
running build_ext
make:core/desugarer.o' is up to date. make:core/formatter.o' is up to date.
make:core/libjsonnet.o' is up to date. make:core/lexer.o' is up to date.
make:core/parser.o' is up to date. make:core/pass.o' is up to date.
make:core/static_analysis.o' is up to date. make:core/string_utils.o' is up to date.
make:core/vm.o' is up to date. make:third_party/md5/md5.o' is up to date.
building '_jsonnet' extension
creating build
creating build/temp.macosx-10.6-intel-3.6
creating build/temp.macosx-10.6-intel-3.6/python
/usr/bin/clang -fno-strict-aliasing -Wsign-compare -fno-common -dynamic -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -arch i386 -arch x86_64 -g -Iinclude -Ithird_party/md5 -I/Library/Frameworks/Python.framework/Versions/3.6/include/python3.6m -c python/_jsonnet.c -o build/temp.macosx-10.6-intel-3.6/python/_jsonnet.o
python/_jsonnet.c:147:19: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (i = 0; i < ctx->argc; ++i) {
~ ^~~~
1 warning generated.
python/_jsonnet.c:147:19: warning: comparison of integers of different signs: 'int' and 'const size_t' (aka 'const unsigned long') [-Wsign-compare]
for (i = 0; i < ctx->argc; ++i) {
~ ^ ~~~
1 warning generated.
creating build/lib.macosx-10.6-intel-3.6
/usr/bin/clang++ -bundle -undefined dynamic_lookup -arch i386 -arch x86_64 -g build/temp.macosx-10.6-intel-3.6/python/_jsonnet.o core/desugarer.o core/formatter.o core/libjsonnet.o core/lexer.o core/parser.o core/pass.o core/static_analysis.o core/string_utils.o core/vm.o third_party/md5/md5.o -o build/lib.macosx-10.6-intel-3.6/_jsonnet.cpython-36m-darwin.so
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
clang: warning: libstdc++ is deprecated; move to libc++ with a minimum deployment target of OS X 10.9 [-Wdeprecated]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command '/usr/bin/clang++' failed with exit status 1
----------------------------------------
Command "/usr/local/bin/python3.6 -u -c "import setuptools, tokenize;__file__='/private/var/folders/sp/4bfpfrfd4m3bx3nl84rvwd5w0000gn/T/pip-install-s0sa1az1/jsonnet/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /private/var/folders/sp/4bfpfrfd4m3bx3nl84rvwd5w0000gn/T/pip-record-akb978cv/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/sp/4bfpfrfd4m3bx3nl84rvwd5w0000gn/T/pip-install-s0sa1az1/jsonnet/
System (please complete the following information):
Additional context
If there are any workarounds, I am very willing to try them. I am blocked by something until I can resolve this issue. Thanks so much.
Closing as a duplicate of #1938. This appears to be a recent problem with macOS Mojave. Hopefully the solution on #1938 helps you.
I am getting the same stacktrace on Ubuntu 14.04, Python 3.6.5, gcc 4.8.4, Pytorch version 1.1.0a0+7f053b2 (latest unstable). Any tips to resolve?
I am getting the same trouble on Windows 10, Python 3.6.5, gcc 7.1.0, Pytorch 1.0.0. And I failed this jsonnet package so allennlp treats my .json file as python json and meets json.decoder.JSONDecodeError when i train your scibert model.
@sarahwie can you try with a more recent Ubuntu and gcc?
@dearchill windows is not officially supported (and I'm not sure if jsonnet will even install on windows), you'll probably have to remove the jsonnet-specific features from the config file
@sarahwie try to install jsonnet separately using conda install -c conda-forge jsonnet and then pip install allennlp
I resolved this by installing the latest version of anaconda on my ubuntu 16.04 instance
It looks like the AllenNLP version on Anaconda is now out of date: https://anaconda.org/allennlp
I solved it by installing the older version of scikit-learn:
pip install scikit-learn==0.20.3
And then you are good to go with:
pip install allennlp
I try to install jsonnect I am getting below error.

I try to install jsonnect I am getting below error.
you may need
apt-get install make
apt-get install g++
in your dockerfile.
Try this:
RUN set -ex \
&& apt-get update -yqq \
&& apt-get install -yqq --no-install-recommends \
make \
g++ \
&& apt-get autoremove -yqq --purge \
&& apt-get clean
@Ravibth you need to install jsonnet using conda install -c conda-forge jsonnet not with the regular pip
Most helpful comment
@sarahwie try to install jsonnet separately using
conda install -c conda-forge jsonnetand thenpip install allennlp