Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip install for Python3 not working #573

Closed
griff4692 opened this issue Oct 25, 2018 · 4 comments
Closed

Pip install for Python3 not working #573

griff4692 opened this issue Oct 25, 2018 · 4 comments

Comments

@griff4692
Copy link

Here is the error stacktrace I am getting when I try to install jsonnet. I am not sure what the error is caused by or if there is a way around it.

Collecting jsonnet
Downloading https://files.pythonhosted.org/packages/4a/f5/a0a41ac1f141a62c966291feff15e1829147462e95041bdc5fee1dcd7e0f/jsonnet-0.11.2.tar.gz (127kB)
100% |████████████████████████████████| 133kB 8.4MB/s
Building wheels for collected packages: jsonnet
Running setup.py bdist_wheel 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-efhuihfi/jsonnet/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 /private/var/folders/sp/4bfpfrfd4m3bx3nl84rvwd5w0000gn/T/pip-wheel-tajcyg17 --python-tag cp36:
running bdist_wheel
running build
running build_ext
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/desugarer.cpp -o core/desugarer.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/formatter.cpp -o core/formatter.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/libjsonnet.cpp -o core/libjsonnet.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/lexer.cpp -o core/lexer.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/parser.cpp -o core/parser.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/pass.cpp -o core/pass.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/static_analysis.cpp -o core/static_analysis.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/string_utils.cpp -o core/string_utils.o
c++ -c -g -O3 -Wall -Wextra -Woverloaded-virtual -pedantic -std=c++0x -fPIC -Iinclude -Ithird_party/md5 core/vm.cpp -o core/vm.o
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.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


Failed building wheel for jsonnet
Running setup.py clean for jsonnet
Failed to build jsonnet
Installing collected packages: jsonnet
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-efhuihfi/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-f4v9_067/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-efhuihfi/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-f4v9_067/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /private/var/folders/sp/4bfpfrfd4m3bx3nl84rvwd5w0000gn/T/pip-install-efhuihfi/jsonnet/

@sbarzowski
Copy link
Collaborator

sbarzowski commented Oct 25, 2018

It looks very much like #570, where it turned out to be a configuration issue not specific to Jsonnet (compiling any C++ program failed) and it was resolved by following an answer from stack overflow. Please check if it's relevant.

@griff4692
Copy link
Author

Thanks so much for the help.

I am on Mojave now and needed to run:

xcode-select --install

Followed by

open /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

Thanks for pointing me in the right direction

@sbarzowski
Copy link
Collaborator

@sparkprime I think we can close this.

@pedrocolon93
Copy link

pedrocolon93 commented Apr 3, 2020

The install xcode never worked for me but this answer did:
facebookresearch/fastText#753 (comment)
Which is simply:
export MACOSX_DEPLOYMENT_TARGET=10.9
Then retry the install! I did this from source, dunno if the pip install works the same but I think so.

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

No branches or pull requests

4 participants