Skip to content
This repository was archived by the owner on Mar 8, 2020. It is now read-only.

failed to install on macos #140

Closed
gregkonushev-okta opened this issue Jan 17, 2019 · 8 comments
Closed

failed to install on macos #140

gregkonushev-okta opened this issue Jan 17, 2019 · 8 comments
Labels

Comments

@gregkonushev-okta
Copy link

I have installed libxml2 from brew,
but pip install bblfsh fails with this error:

In file included from bblfsh/libuast/uast.cc:4:
bblfsh/libuast/uast_private.h:4:10: fatal error: 'libxml/tree.h' file not found
#include <libxml/tree.h>
         ^~~~~~~~~~~~~~~
1 error generated.
error: command 'g++' failed with exit status 1

@creachadair
Copy link
Contributor

creachadair commented Jan 17, 2019

I believe libxml2 is keg-only, because Homebrew doesn't want to introduce link-time conflicts with existing system libraries. You may need to tell pip where the Homebrew include and lib paths are, though, perhaps something like:

env CFLAGS="-I$(brew --prefix)/opt/libxml2/include/libxml2" pip install bblfsh

Edit: fix missing flag.

@juanjux
Copy link
Contributor

juanjux commented Jan 18, 2019

Yes, as explained in the Dependencies section of the readme, this client depends on having libxml2 headers installed.

Next version will remove that requirement.

@creachadair
Copy link
Contributor

Yes, as explained in the Dependencies section of the readme, this client depends on having libxml2 headers installed.

I think the problem was that they are installed, but Homebrew doesn't automatically link them to the default include path.

@gregkonushev-okta
Copy link
Author

For Mojave MacOS I was able to solve this problem by installing command line tools from /Library/Developer/CommandLineTools/Packages/macOS_SDK_headers_for_macOS_10.14.pkg

@bzz bzz added the question label Jan 24, 2019
@bzz
Copy link
Contributor

bzz commented Jan 24, 2019

Thank you for reporting workaround @gregkonushev-okta 🎉

Will close this, if there no objections as a workaround is found AND a it's not worth documenting it elsewhere as @juanjux mentioned - a new version from #128 will not have this dependency at all.

@bzz bzz closed this as completed Jan 24, 2019
@alichtman
Copy link

alichtman commented Mar 21, 2019

I just ran into this same issue, and the command that fixed the problem for me was:

env CFLAGS="-I$(brew --prefix)/opt/libxml2/include/libxml2" pip3 install bblfsh

From @creachadair

It would be helpful if this were added to the README. I do not think #128 fixed this issue.

@creachadair
Copy link
Contributor

I just ran into this same issue, and the command that fixed the problem for me was:

env CFLAGS="-I$(brew --prefix)/opt/libxml2/include/libxml2" pip3 install bblfsh

From @creachadair

It would be helpful if this were added to the README. I do not think #128 fixed this issue.

I believe #128 removes the dependency, but that the current release doesn't include it yet. We are planning to cut a release including these changes soon, and at that point this workaround should no longer be required. Sorry for the confusion about timing.

@bzz
Copy link
Contributor

bzz commented Mar 25, 2019

And v3.0.0 release is out now on pypi.

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

No branches or pull requests

5 participants