Skip to content
This repository has been archived by the owner on Dec 16, 2022. It is now read-only.

install failes: command 'g++' failed with exit status 1 #1938

Closed
nityansuman opened this issue Oct 23, 2018 · 12 comments
Closed

install failes: command 'g++' failed with exit status 1 #1938

nityansuman opened this issue Oct 23, 2018 · 12 comments

Comments

@nityansuman
Copy link

nityansuman commented Oct 23, 2018

~$ pip install allennlp

c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 third_party/md5/md5.cpp -o third_party/md5/md5.o
building '_jsonnet' extension
creating build
creating build/temp.macosx-10.7-x86_64-3.6
creating build/temp.macosx-10.7-x86_64-3.6/python
gcc -Wno-unused-result -Wsign-compare -Wunreachable-code -DNDEBUG -g -fwrapv -O3 -Wall -Wstrict-prototypes -I/Users/nityansuman/anaconda3/envs/coref_resolution/include -arch x86_64 -I/Users/nityansuman/anaconda3/envs/coref_resolution/include -arch x86_64 -Iinclude -Ithird_party/md5 -I/Users/nityansuman/anaconda3/envs/coref_resolution/include/python3.6m -c python/_jsonnet.c -o build/temp.macosx-10.7-x86_64-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.
creating build/lib.macosx-10.7-x86_64-3.6
g++ -bundle -undefined dynamic_lookup -L/Users/nityansuman/anaconda3/envs/coref_resolution/lib -arch x86_64 -L/Users/nityansuman/anaconda3/envs/coref_resolution/lib -arch x86_64 -arch x86_64 build/temp.macosx-10.7-x86_64-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.7-x86_64-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]
ld: library not found for -lstdc++
clang: error: linker command failed with exit code 1 (use -v to see invocation)
error: command 'g++' failed with exit status 1


Failed building wheel for jsonnet

Command "/Users/nityansuman/anaconda3/envs/coref_resolution/bin/python -u -c "import setuptools, tokenize;file='/private/var/folders/0p/gsfhfkcj45525788hzflpnqr0000gn/T/pip-install-1p81vfqm/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/0p/gsfhfkcj45525788hzflpnqr0000gn/T/pip-record-1rx4hog1/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/0p/gsfhfkcj45525788hzflpnqr0000gn/T/pip-install-1p81vfqm/jsonnet/

MacOs Mojave
Python 3.6.6

@nityansuman nityansuman changed the title command 'g++' failed with exit status 1 install failes: command 'g++' failed with exit status 1 Oct 23, 2018
@schmmd
Copy link
Member

schmmd commented Oct 23, 2018

Interesting and a bit surprising. The development team uses MacOS and we test pip install allennlp for every commit to master in our Docker build. I'll try re-creating my conda environment.

As a work-around you could run AllenNLP within Docker.

@matt-gardner
Copy link
Contributor

Relevant: ContinuumIO/anaconda-issues#10135

@schmmd
Copy link
Member

schmmd commented Oct 23, 2018

I was able to pip install allennlp in a fresh environment just fine on High Sierra. Combined with the issue @matt-gardner linked suggests your error is related to Mojave.

@nityansuman
Copy link
Author

@schmmd yes... i strongly believe too.

Got the work around!
conda install allennlp -c pytorch -c allennlp -c conda-forge

@nityansuman
Copy link
Author

@matt-gardner thanks!

@schmmd
Copy link
Member

schmmd commented Nov 1, 2018

I upgraded to Mohave today and did a fresh install of AllenNLP without any problems (including jsonnet). Of course--your mileage may vary ;-)

@hxbai
Copy link

hxbai commented Nov 13, 2018

This solve my problem:
google/jsonnet#573

@DukeEnglish
Copy link

@schmmd yes... i strongly believe too.

Got the work around!
conda install allennlp -c pytorch -c allennlp -c conda-forge

I got this problem when I run this command....

PackageNotFoundError: Dependencies missing in current osx-64 channels:

  • allennlp -> gevent 1.3.5
  • allennlp -> pytorch >=0.4.0,<0.5.0 -> mkl >=2018

@DukeEnglish
Copy link

@schmmd yes... i strongly believe too.
Got the work around!
conda install allennlp -c pytorch -c allennlp -c conda-forge

I got this problem when I run this command....

PackageNotFoundError: Dependencies missing in current osx-64 channels:

  • allennlp -> gevent 1.3.5
  • allennlp -> pytorch >=0.4.0,<0.5.0 -> mkl >=2018

I got it by setting the environmental variable MACOSX_DEPLOYMENT_TARGET:
Just run export MACOSX_DEPLOYMENT_TARGET=10.14

Thanks to:
ContinuumIO/anaconda-issues#10135

BTW, for some Chinese friend, 请看这里:
https://zhuanlan.zhihu.com/p/61890029

@rkingery
Copy link

@schmmd yes... i strongly believe too.

Got the work around!
conda install allennlp -c pytorch -c allennlp -c conda-forge

When trying to run this command I get the following odd error, which seemingly comes from trying to parse the conda-forge part.

$ conda install allennlp -c pytorch -c allennlp -c conda-forge
Solving environment: failed

CondaValueError: Malformed version string '~': invalid character(s).

@XMUBQ
Copy link

XMUBQ commented Jun 24, 2019

@schmmd yes... i strongly believe too.
Got the work around!
conda install allennlp -c pytorch -c allennlp -c conda-forge

I got this problem when I run this command....
PackageNotFoundError: Dependencies missing in current osx-64 channels:

  • allennlp -> gevent 1.3.5
  • allennlp -> pytorch >=0.4.0,<0.5.0 -> mkl >=2018

I got it by setting the environmental variable MACOSX_DEPLOYMENT_TARGET:
Just run export MACOSX_DEPLOYMENT_TARGET=10.14

Thanks to:
ContinuumIO/anaconda-issues#10135

BTW, for some Chinese friend, 请看这里:
https://zhuanlan.zhihu.com/p/61890029

谢谢哥

@afsangujarati93
Copy link

@schmmd yes... i strongly believe too.

Got the work around!
conda install allennlp -c pytorch -c allennlp -c conda-forge

This worked after creating and activating the conda virtual environment
conda create -n allennlp python=3.6
source activate allennlp

Reference: https://pypi.org/project/allennlp/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants